Today, we’re thrilled to announce the release of Capacitor 4.0 🎉. This new major version brings not only a bunch of bug fixes and improvements to the overall codebase, but also bumps the minimum SDK targets to support new Google Play policies. For folks with existing apps, fear not, upgrading to Capacitor 4.0 is nothing like past releases. Given the rock solid base we created in v3, Capacitor 4.0 only requires a few changes to existing code.

Migrating an Existing App

For folks with existing apps, migrating to Capacitor 4.0 should only require a few changes to your overall codebase. A full migration guide can be found on the docs, which will walk you through the whole process. Install the latest version of the Capacitor CLI to your project using:

npm i -D @capacitor/cli@latest

Once installed, simply run npx cap migrate to have the CLI handle the migration for you. If any of the steps for the migration are not able to be completed, additional information will be made available in the output in the terminal.

Or, for anyone using VS Code, install our Ionic Extension for a 1-click migration. Simply click the “Migrate to Capacitor 4” in your Recommendations and the extension will take care of the rest.

For Plugins, there are a few changes that have been made, so I’d suggest reviewing the Plugins section of the migration docs.

That’s all now, folks! We’re thrilled to ship this new version of Capacitor and can’t wait for you all to update your apps. Cheers!

Sign up for the Ionic Newsletter to get the latest news and updates!

Notable Replies

  1. Hi, guy,
    Congragulations! First of all, congratulations to your team. After your unremitting efforts, you are amazing! Keep it up. Come on

  2. thank you so much!
    So, do you suggest to update right now?

    And what about migratin a capacitor 2 app to 4? Should we go from 2 to 3 and then from 3 to 4?

    thanks!

  3. I’d suggest doing the 2 => 3 => 4 migration process. Trying to do too many things at once can be a bit much to digest.

  4. I would open an issue on the capacitor repo for this. I haven’t personally seen this but that doesn’t mean a bug doesn’t potentially exist.

Join the discussion on the Ionic Forum

18 more replies

Participants