Updating from Capacitor 8 to Capacitor 9
In this guide, you'll find steps to update your project to the current Capacitor 9 version as well as a list of breaking changes.
Breaking changes in @capacitor/android
Capacitor 9 removes the Java APIs that were deprecated in previous major versions. If your app or plugin still uses any of them, replace them as follows.
| Removed | Replacement |
|---|---|
CapConfig(AssetManager, JSONObject) constructor | CapConfig.loadDefault(Context) to load from capacitor.config.json, or CapConfig.Builder for embedded use |
CapConfig.getObject(String), getString(...), getBoolean(...), getInt(...), getArray(...) | The typed getters on CapConfig for main config values and the PluginConfig accessors for plugin config values |
PluginCall.save() | setKeepAlive(true) |
PluginCall.isSaved() | isKeptAlive() |
PluginCall.hasOption(String) | Typed accessors (getString(...), getInt(...), etc.) |
PluginCall.isReleased() | No replacement, released calls are managed by the bridge |
Bridge.CAPACITOR_HTTPS_INTERCEPTOR_START | CAPACITOR_HTTP_INTERCEPTOR_START, all proxied requests are handled by it |
Plugin.getConfigValue(String) | getConfig() and the typed accessors on PluginConfig |
MessageHandler(Bridge, WebView, Object) constructor | MessageHandler(Bridge, WebView) |