Skip to content

refactor(android)!: remove deprecated Java APIs for Capacitor 9 - #8553

Merged
andredestro merged 5 commits into
nextfrom
chore/RMET-5304-remove-deprecated-android-apis
Aug 6, 2026
Merged

refactor(android)!: remove deprecated Java APIs for Capacitor 9#8553
andredestro merged 5 commits into
nextfrom
chore/RMET-5304-remove-deprecated-android-apis

Conversation

@andredestro

@andredestro andredestro commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Removes the Java APIs marked @Deprecated in previous major versions, as part of the Capacitor 9 cleanup (RMET-5304). All of them have direct replacements that have been available since Capacitor 3.

Removed Replacement
CapConfig(AssetManager, JSONObject) constructor CapConfig.loadDefault(Context) or CapConfig.Builder
CapConfig.getObject(String), getString(...), getBoolean(...), getInt(...), getArray(...) Typed getters on CapConfig for main config values; PluginConfig accessors for plugin config values
PluginCall.save() setKeepAlive(true)
PluginCall.isSaved() isKeptAlive()
PluginCall.hasOption(String) Typed accessors (getString(...), getInt(...), etc.)
PluginCall.isReleased() (and the backing isReleased flag) No replacement, released calls are managed by the bridge
Bridge.CAPACITOR_HTTPS_INTERCEPTOR_START CAPACITOR_HTTP_INTERCEPTOR_START
Plugin.getConfigValue(String) getConfig() and the typed accessors on PluginConfig
MessageHandler(Bridge, WebView, Object) constructor MessageHandler(Bridge, WebView)

Intentionally kept: the legacy @NativePlugin ecosystem (the NativePlugin annotation and the deprecated permission/activity-result cluster in Plugin and Bridge: saveCall, getSavedCall, freeSavedCall, hasDefinedPermissions, hasPermission, pluginRequestPermission(s), handleOnActivityResult, startActivityForResult(int), getPluginWithRequestCode, startActivityForPluginWithResult). Those are still wired into the legacy permission handling and their removal is being evaluated separately (RMET-5305).

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

Capacitor 9 is a major release, which is the opportunity to drop APIs that have been deprecated for several majors. This reduces the public API surface and makes the remaining deprecation warnings actionable again. It is the Android counterpart of the iOS cleanup in #8551.

Tests or Reproductions

  • ./gradlew :capacitor-android:testDebugUnitTest passes.
  • prettier (used by the repository's npm run lint for Java) reports no violations on the changed files.
  • Built and ran capacitor-testapp against this branch on an API 36 emulator: all official plugins compile against the new API surface, the bridge starts, all plugins register and the app renders and responds normally.
  • Verified there are no remaining references to the removed symbols across the repository (source and tests).

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

…ic accessors

Removes the deprecated CapConfig(AssetManager, JSONObject) constructor and
the generic getObject/getString/getBoolean/getInt/getArray accessors. Use
CapConfig.loadDefault(Context) or the CapConfig.Builder to construct a
config, the typed getters for main config values and PluginConfig for
plugin config values.
Removes save(), isSaved(), hasOption() and isReleased() along with the
backing isReleased flag. Use setKeepAlive(Boolean), isKeptAlive() and the
typed accessors instead.
…RT constant

All proxied requests are handled via CAPACITOR_HTTP_INTERCEPTOR_START.
Use getConfig() and the typed accessors on PluginConfig instead.
Removes the constructor taking an unused cordovaPluginManager argument.
Use MessageHandler(Bridge, WebView) instead.
@andredestro
andredestro merged commit c6f5754 into next Aug 6, 2026
6 of 7 checks passed
@andredestro
andredestro deleted the chore/RMET-5304-remove-deprecated-android-apis branch August 6, 2026 15:32
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.

3 participants