Phase 7

Troubleshooting

The errors you will actually hit

As needed

Symptom-first fixes for the failures that come up again and again. Search this page before you search the web.

01

The app opens to a white screen

  1. Connect the device and open chrome://inspect in desktop Chrome (Android) or Safari → Develop (iOS). Read the console.
  2. Wrong `webDir` — it must match your build output folder exactly.
  3. You forgot to rebuild — run npm run build before npx cap sync.
  4. A leftover `server.url` in capacitor.config.ts pointing at a dev machine.
  5. Absolute asset paths — the app is served from capacitor://localhost, so a path assuming a domain root can 404.
  6. A crash during render — an unguarded browser API on the first screen.
02

Changes do not appear in the app

bash
npm run build && npx cap sync && npx cap open android

If it still shows the old UI: uninstall the app from the device (stale web-view cache), then Build → Clean Project in Android Studio and reinstall.

03

Gradle and JDK errors

MessageCause and fix
Unsupported class file major versionWrong JDK. Android Studio → Settings → Build Tools → Gradle → set Gradle JDK to 17.
SDK location not foundCreate android/local.properties with sdk.dir=/path/to/Android/sdk.
Could not resolve com.android.tools.build:gradleNo network or a proxy; check gradle-wrapper.properties distribution URL.
Execution failed for task ':app:processReleaseResources'Usually a malformed icon or an XML asset; regenerate assets and clean.
Daemon disappeared / OOMAdd org.gradle.jvmargs=-Xmx4096m to android/gradle.properties.
bash
cd android && ./gradlew clean && ./gradlew --stop && ./gradlew bundleRelease
04

Signing and upload rejections

MessageFix
You uploaded an APK that is not signed with the upload certificateYou used a different keystore. Use the original, or request an upload key reset in Play Console.
Version code N has already been usedIncrease versionCode in android/app/build.gradle and rebuild.
You uploaded a debuggable APKYou built the debug variant. Use bundleRelease.
Your app targets API level XRaise targetSdk (and compileSdk) to the level Play requires, then retest.
Invalid Bundle. Missing Info.plist keyAdd the missing NS*UsageDescription string.
ITMS-90717 Invalid App Store IconThe 1024px icon has an alpha channel — flatten it.
No profiles for 'com.example.myapp' were foundRegister the App ID in the developer portal, then re-enable automatic signing.
05

Network requests fail only in the app

  • Relative URLs resolve against capacitor://localhost. Use absolute HTTPS URLs.
  • Your API must send CORS headers allowing capacitor://localhost and http://localhost, or use the native HTTP layer.
  • Plain HTTP is blocked in release builds on both platforms. Use HTTPS.
  • Cookie-based sessions are unreliable in the web view — use bearer tokens with the Preferences plugin.
Allowing the app origin on your API
const allowed = [
  "https://your-app.lovable.app",
  "capacitor://localhost",
  "http://localhost",
];
06

I lost my keystore

  • With Play App Signing enabled: Play Console → Setup → App integrity → request an upload key reset. Generate a new keystore, upload its certificate, and continue publishing the same listing.
  • Without Play App Signing: the listing cannot be updated. You must publish a new app with a new application ID and migrate users manually. This is why the backup step is non-negotiable.
07

Plugin installed but not available at runtime

bash
npm install @capacitor/the-plugin
npx cap sync            # required — installs the native side
# iOS additionally:
cd ios/App && pod install && cd ../..

"Plugin is not implemented on web" is expected in the browser — guard calls with Capacitor.isNativePlatform(). The same error on a device means cap sync did not run or the native build is stale.