Skip to content

docs: add Capacitor 9 app upgrade guide - #589

Open
andredestro wants to merge 3 commits into
mainfrom
chore/RMET-5320-cap9-app-upgrade-guide
Open

docs: add Capacitor 9 app upgrade guide#589
andredestro wants to merge 3 commits into
mainfrom
chore/RMET-5320-cap9-app-upgrade-guide

Conversation

@andredestro

@andredestro andredestro commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Adds docs/main/updating/9-0.md, the "Updating to 9.0" app upgrade guide, and registers it in the Upgrade Guides sidebar (sidebars.js).

Covers app-level changes only:

  • Cordova support becoming optional (what changed, that there's currently no opt-out, and the implications for code that directly references Capacitor's Cordova compatibility layer)
  • Breaking changes in @capacitor/cli (--url replacing the separate live-reload flags)
  • Breaking changes in @capacitor/android (minSdk 26, compileSdk/targetSdk 37, AGP 9.2.1 / Gradle 9.5.1, the proguard-android.txt rename, androidx.core 1.19 / core-ktx, removing standalone Kotlin plugin references, jcenter() removal)
  • Breaking changes in @capacitor/ios (deployment target 16.0, @main replacing @UIApplicationMain, a pointer to the 8.5 guide for UIScene if updating from 8.4 or earlier)
  • NodeJS 24+, Using the CLI to Migrate, and the manual iOS/Android upgrade steps (Xcode, Android Studio, variables.gradle, Gradle wrapper, google-services)
  • A Plugins summary (Action Sheet, Browser, Barcode Scanner, Camera, Geolocation, Google Maps, InAppBrowser, Push Notifications, Splash Screen)

Change Type

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

Rationale / Problems Fixed

Capacitor 9 needs an "Updating to 9.0" guide before GA so app developers upgrading from 8.x have a single place documenting breaking changes and migration steps, and so Capacitor CLI and other components can link to it.

Internal Jira reference: https://outsystemsrd.atlassian.net/browse/RMET-5320

Tests or Reproductions

Content was cross-checked against the actual merged PRs in ionic-team/capacitor and ionic-team/capacitor-plugins (and sibling plugin repos) that introduce each breaking change, plus the current next branch state of the Android/iOS templates (variables.gradle, app/build.gradle, Podfile, etc.) to confirm the exact version numbers. Verified npm run build (Docusaurus) succeeds and the new page renders at /next/updating/9-0/ with no broken links.

Note: Capacitor 9 hasn't reached GA yet, so the guide's install instructions point at the next dist-tag (@capacitor/cli@next) rather than @latest.

Screenshots / Media

N/A

Platforms Affected

  • Android
  • iOS
  • Web

Covers app-level changes only (Cordova-optional, CLI, Android/iOS
breaking changes, upgrade steps, plugin summary). Deprecated-API
removal tables and the plugin-author guide are tracked separately
(RMET-4728, RMET-5321).

RMET-5320
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
capacitor-docs Ready Ready Preview Aug 14, 2026 11:43am

Request Review

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left a few comments. If some of them are better to address offline, let me know!

Comment thread docs/main/updating/9-0.md
- On Android, the generated `settings.gradle` and app `build.gradle` no longer include the `capacitor-cordova-android` / `capacitor-cordova-android-plugins` modules.
- On iOS, `CapacitorCordova` is no longer added to your `Podfile` or `Package.swift`.

There is currently no configuration option to force-include the Cordova runtime when no Cordova plugin is present. If your app's native code (or a plugin you maintain) directly references symbols from Capacitor's Cordova compatibility layer — for example `com.getcapacitor.cordova.CordovaPlugin` on Android, or anything from the `CapacitorCordova` pod/product on iOS — without having an actual Cordova plugin installed, those references will fail to resolve after upgrading. Add a Cordova plugin dependency (even a trivial one) if you need the layer present, or remove the direct reference.

@OS-pedrogustavobilro OS-pedrogustavobilro Aug 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This paragraph may change soon with this task but I suppose for now it's true. Just something to keep in mind, we may want to revise this doc in the near future after this PR is merged.

Comment thread docs/main/updating/9-0.md Outdated
Comment on lines +44 to +55
AGP 9 no longer ships `proguard-android.txt` — any `build.gradle` that still references it fails at Gradle configuration time, even with `minifyEnabled false`:

```groovy
// Before — hard build error on AGP 9
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// After
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
```

`androidx.core:core` 1.19.0 merges every extension function previously shipped in `core-ktx` into `core` itself, turning `core-ktx` into an empty compatibility artifact. If your app (or an old/community plugin it depends on) still explicitly pins `core-ktx` to a version older than `1.19.0`, you may hit a duplicate class error at build time; remove the explicit `core-ktx` version override.

AGP 9 also bundles the Kotlin Gradle Plugin natively and removes the `jcenter()` repository helper entirely. These are unlikely to affect your app directly, but can break the build if you (or a legacy/community plugin) still apply Kotlin standalone or reference `jcenter()` — see [Update Kotlin and remove jcenter()](#update-kotlin-and-remove-jcenter) below.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Trying to think if these changes would go on @capacitor/android or in separate sections. You mention the proguard and Kotlin / jcenter in their own sections, so this feels like duplicated information here.

The core isn't mentioned below I guess, but could be moved below to its own subsection perhaps?

And here at most we would like to those sections?

Let me know if that makes sense.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@andredestro I'm unsure if the update structure from your latest commit is still "the best it can be". When I look at https://capacitorjs.com/docs/updating/8-0 that structure makes more sense to me where it lists:

  • "Breaking changes in @capacitor/android" - which are changes in the platform that are not covered by CLI migration; so in this case things like minSdk and proguard would not be in that category, and they are not breaking changes introduced by capacitor android
  • "Breaking changes in @capacitor/ios" - similarily to Android, things like deployment target and @main replacing @UIApplicationMain are covered by cap migrate, and they are not breaking changes introduced by capacitor ios.

If you disagree or think the current structure is better, do let me know!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, that structure makes more sense. Pushed a commit that trims "Breaking changes in @capacitor/android" and "@capacitor/ios" down to what cap migrate doesn't already fix (minSdk/compileSdk, the proguard rename, deployment target, and @main all moved out, they're fully covered by the manual steps below). Kept core-ktx and the standalone Kotlin/jcenter mentions there since those aren't automated.

Comment thread docs/main/updating/9-0.md Outdated
Comment thread docs/main/updating/9-0.md
Comment thread docs/main/updating/9-0.md Outdated
Comment thread docs/main/updating/9-0.md
Comment thread docs/main/updating/9-0.md
Comment thread docs/main/updating/9-0.md Outdated
Comment thread docs/main/updating/9-0.md Outdated
- Move "Using the CLI to Migrate" above the breaking-changes sections
  that cap migrate automates (Android/iOS), so readers try it first
- Trim duplicated proguard/kotlin/jcenter details from the
  @capacitor/android summary, add a dedicated core-ktx-to-core section
- Note npm 11 ships with Node 24 (vs npm 10 with Node 22)
- Use the exact CocoaPods Trunk read-only date and link to the SPM guide
- Document removing targetSdkVersion from the app's build.gradle
- Fix the Kotlin removal example to start from 2.2.20, not 1.9.10
- Fill in and alphabetize per-plugin variable bumps (Barcode Scanner,
  Camera, Geolocation, InAppBrowser) instead of vague placeholders

Addresses review comments from @OS-pedrogustavobilro on PR #589.
Comment thread docs/main/updating/9-0.md Outdated
Per PR feedback: "Breaking changes in @capacitor/X" should only list
what cap migrate doesn't already fix. Removes minSdk/compileSdk and
the proguard rename from the Android section (fully covered by
"Update Android Project Variables" / "Rename the default ProGuard
file" below), and removes the deployment target / @main mentions
from the iOS section (covered by "Raise iOS Deployment Target" and
the new "Replace @UIApplicationMain with @main" step). Also trims
the targetSdkVersion removal note down to a single sentence.
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