Skip to content

chore(cli): migrate changes for Capacitor 9#8521

Open
jcesarmobile wants to merge 5 commits into
nextfrom
RMET-4736
Open

chore(cli): migrate changes for Capacitor 9#8521
jcesarmobile wants to merge 5 commits into
nextfrom
RMET-4736

Conversation

@jcesarmobile

Copy link
Copy Markdown
Member

The links to the docs don't exist yet, we should create them before releasing this, but the docs tasks are not on the sprint.

Also it will probably need some more changes in the future depending on what breaking changes we make in the plugins or if we make more changes on the templates.

Comment thread cli/src/tasks/migrate.ts Outdated
Comment thread cli/src/tasks/migrate.ts
Comment thread cli/src/tasks/migrate.ts Outdated
const pluginVersion = 'next';
const gradleVersion = '9.5.1';
const iOSVersion = '16';
const kotlinVersion = '2.4.0';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we no longer be replacing kotlin version for classpath, and instead remove it? Because it's now bundled in AGP 9?

We added it in Capacitor 8 to fix an issue related to an app declaring the kotlin version in root build.gradle and it differing from the one Capacitor / Plugins use. Internal Slack Thread. But AGP bundles kotlin gradle plugin it's probably better to not have it in the app, and instead remove it altogether perhaps?

But also, we are using Kotlin 2.4.0 here and AGP 9.2 uses 2.3.10. But since it's a minor version change it should be ok (where last year it was a major version).

If you think this is better left to a separate task / PR let me know, but just wanted to highlight it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only added the new changes, haven't removed anything from last year, we usually don't remove previous changes for a while since some apps might have missed some changes, if updated during beta and didn't rerun migrate once it was final, I've found this problem specially in our test apps
https://github.com/ionic-team/capacitor-geolocation/pull/89/changes#diff-e525140166db601268205422ea95ecdeaac1306e2b96807222cdfcde1cb0c951
https://github.com/ionic-team/capacitor-geolocation/pull/89/changes#diff-e56dd649cbbb6fce23fa286ee7e1e8df7abeecb68bd1a86f623eea74c98a4746

But yeah, we should remove this, we shouldn't have added it to begin with since the official template doesn't have kotlin, and using 2.4.0 causes issues as it's not yet compatible with latest AGP, the value was updated by Rui in a previous PR, I haven't changed it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure we're on the same page, when I said to remove it, I mean for the command to remove the kotlin versions / gradle plugin from app's root build.gradle, not remove the logic that changes the version and have the command not touch anything in regards to kotlin.

This could mean changing the apps that explicitly declare the kotlin version, but I'd say it's worse to leave it there if AGP version comes with kotlin gradle plugin (especially if the version declared is lower than the one AGP uses it would fail the build)

@jcesarmobile jcesarmobile Jul 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't plan to do that, migrate command is to keep apps in sync with our templates and our android template doesn't use kotlin.
None our the test apps I've updated so far has kotlin enabled since it's not needed to have kotlin enabled in the app to use kotlin plugins.

The OutSystems template used to have kotlin enabled and that might be why we had that into consideration in previous years, but it doesn't have it enabled anymore and also OS users will most likely not use migrate command anyway since they get latest template on app build and if they did, it might not work since the templates are different.

But I've removed the logic to update the kotlin version since 2.4.0 is not compatible with current AGP.

Comment thread cli/src/tasks/migrate.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants