Skip to content

refactor(android)!: drop legacy @NativePlugin annotation support - #8563

Merged
OS-ruimoreiramendes merged 2 commits into
nextfrom
fix/RMET-5305/drop-native-plugin-v2
Aug 11, 2026
Merged

refactor(android)!: drop legacy @NativePlugin annotation support#8563
OS-ruimoreiramendes merged 2 commits into
nextfrom
fix/RMET-5305/drop-native-plugin-v2

Conversation

@OS-ruimoreiramendes

Copy link
Copy Markdown
Contributor

Description

Removes the legacy @NativePlugin annotation and its associated permission/activity result machinery, as part of the Capacitor 9 cleanup. @NativePlugin has been @Deprecated since Capacitor 3.0.0 (May 2021) in favor of @CapacitorPlugin.

ref: RMET-5305 (decision spike + implementation)

Change Type

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

Rationale / Problems Fixed

Capacitor 9 is a major release, the natural moment to drop APIs that have been deprecated for several majors.
@NativePlugin has been deprecated for 5+ years, and every published plugin still using it is frozen at Capacitor 3–4 (2020–2022) with many other breaking API dependencies that already prevent it from running on modern Capacitor.

Tests or Reproductions

  • ./gradlew :capacitor-android:compileDebugJavaWithJavac and :capacitor-cordova-android:compileDebugJavaWithJavac pass with no warnings.
  • ./gradlew :capacitor-android:testDebugUnitTest passes.
  • Full ./gradlew build passes.
  • CLI regex change verified via npx cap sync android on capacitor-testapp (20 plugins discovered correctly).
  • Runtime validation on a Samsung Galaxy S24 FE (Android 16) with @capacitor/android linked locally against this branch:
    • @capacitor/camera: permission dialog + camera activity + photo delivered back.
    • @capacitor/share: 4 scenarios (success, cancel, empty payload validation, share of photo path).
    • @capacitor/geolocation (via capacitor-geolocation example-app): permission dialog, native execution, JS callback with error propagation.
    • cordova-plugin-inappbrowser: __CordovaPlugin registers, Cordova bridge interceptor routes JS to Native, InAppBrowser lifecycle completes cleanly. Confirms Cordova compatibility is not broken.

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

Comment thread android/capacitor/src/main/java/com/getcapacitor/Plugin.java Outdated
@OS-ruimoreiramendes
OS-ruimoreiramendes force-pushed the fix/RMET-5305/drop-native-plugin-v2 branch from 7aa1213 to de59c2b Compare August 11, 2026 16:36
@OS-ruimoreiramendes
OS-ruimoreiramendes merged commit b310594 into next Aug 11, 2026
6 checks passed
@OS-ruimoreiramendes
OS-ruimoreiramendes deleted the fix/RMET-5305/drop-native-plugin-v2 branch August 11, 2026 16:43
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