This guide covers the correct update workflow for your Capacitor Android build and Google Play Console uploads.
Use this when you just want to test changes on a plugged-in device or emulator.
-
Build the web app
cd web npm run build -
Copy web assets into Android
npx cap copy android
-
Run from Android Studio
- Open Android Studio:
npx cap open android - Click Run (▶) to install a debug build on your device
- Open Android Studio:
✅ No versionCode changes required for local debug runs.
Use this when you want to upload a new build to Internal / Closed / Open / Production tracks.
Google Play requires that every uploaded App Bundle has a new, never-before-used versionCode.
If you try to upload another AAB with the same versionCode, you'll see:
“Version code 1 has already been used. Try another version code.”
This is expected behavior.
Edit:
web/android/app/build.gradle
In defaultConfig, update these:
versionCode 2
versionName "1.1"Rules:
versionCodemust always increase (1 → 2 → 3 → ...). Never reuse a number.versionNameis what users see (e.g., 1.0, 1.1). You can keep it in sync with your release notes.
cd web
npm run buildIf you only changed web code, copy is enough:
npx cap copy androidIf you added/changed plugins or native config, run sync:
npx cap sync androidIn Android Studio:
- Build → Generate Signed Bundle / APK…
- Choose Android App Bundle (AAB)
- Select your keystore and Release variant
- Finish
Android Studio outputs something like:
web/android/app/release/app-release.aab
(or it may show the exact path at the end of the wizard)
- Go to the track you’re using (Internal / Closed / Open / Production)
- Upload the new
.aab
If Play Console complains about a reused version code, you missed Step 1.
Because you have minify enabled in release builds, Play Console may warn about missing deobfuscation.
After building a release AAB, the mapping file is typically here:
web/android/app/build/outputs/mapping/release/mapping.txt
Upload it in Play Console under the bundle’s Deobfuscation files section.
-
versionCodeincremented (must be unique) -
versionNameupdated (recommended) -
npm run buildran successfully -
npx cap copy android(orsync) ran successfully - Generated Signed AAB (Release)
- Uploaded AAB to the correct track
- Uploaded
mapping.txt(recommended)
Fix: bump versionCode in web/android/app/build.gradle, rebuild the signed AAB, upload again.
Fix:
npm run buildnpx cap copy android- Uninstall the old app from the device (clears cached web assets) and reinstall
- Android Studio Run = debug build (not for Play Store)
- Play Store requires signed release AAB
versionCode: simple counter (1, 2, 3, 4…)versionName: semantic-ish (1.0, 1.1, 1.2…)