Skip to content

Conversation

@OS-pedrogustavobilro
Copy link

@OS-pedrogustavobilro OS-pedrogustavobilro commented Nov 7, 2025

PR description

This PR updates the migrate.ts task to Capacitor 8, mostly updating dependency versions, but with a new addition to update app's build.gradle - see commits for list of changes.

Testing

I tested this command on a few capacitor apps (as well as testing the apps after running the command), for instance:

You can test yourself by checking this branch, and mapping the cli version to the local source code directory (make sure you run build in cli directory beforehand), then run npx cap migrate on the app.

If you want to run a second time in the same app, you'll need to manually change the version for cli every time, because the migrate command will change the versions of capacitor next. If you're running the migrate command a second time, you can avoid running npm install (replying n to the second question), to not override the cli version afterwards (core and android and ios should already be using next from running migrate the first time, so nothing should change).

For now, only status-bar has the possibility of breaking changes.

May still be changed.
Matches what Capacitor Google Maps is using as default if no variable exists
Capacitor 8 added density to "configChanges" property for the Android template, this makes sure it's also added there.

Re-uses the existing command for navigation, which came from Capacitor 7.
The gradle version that Capacitor 8 uses brings upon warnings that would eventually turn into compilation errors.

This commit adds a step to fix those app/build.gradle, by making use of the updated Groovy Gradle DSL syntax for assigning certain properties in the gradle file. This way, the build.gradle will resemble that of the updated android app template for Cap 8.
Tested on several existing capacitor apps that use existing plugins, all is working with the latest versions.
@OS-pedrogustavobilro OS-pedrogustavobilro self-assigned this Nov 7, 2025
Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

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

We have a call to patchOldCapacitorPlugins, which then calls to movePackageFromManifestToBuildGradle, which moves plugin package names from the AndroidManifest.xml to the build.gradle as namespace.
That should be revisited so it adds it as namespace =.
Or maybe the whole patchOldCapacitorPlugins can be removed at this point since all plugins should have moved the package name to the build.gradle.
In case we remove it, the update.ts file should remove the calls to that method too.

@OS-pedrogustavobilro
Copy link
Author

@jcesarmobile removed the method since all plugins should already be using namespace now, otherwise they would not work with Capacitor 7 (or older even).

@jcesarmobile
Copy link
Member

Can you remove the , please check out the Ionic vscode extension for this functionality. text from the monorepo warning since the Ionic vscode extension is no longer supported?

@OS-pedrogustavobilro
Copy link
Author

OS-pedrogustavobilro commented Nov 12, 2025

Can you remove the , please check out the Ionic vscode extension for this functionality. text from the monorepo warning since the Ionic vscode extension is no longer supported?

@jcesarmobile So what should be used instead to allow to run this tool in a mono-repo type environment?

@jcesarmobile
Copy link
Member

jcesarmobile commented Nov 12, 2025

I don't know, but not the Ionic extension.
Maybe just do the migration manually.

Ionic VC Code extension is no longer support, suggest manual migration instead.
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.

6 participants