capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

[Bug]: Android capacitor crashes on subsequent launch if versionCode/versionName omitted

Open aeharding opened this issue 1 year ago • 0 comments

Capacitor Version

[warn] The bundledWebRuntime configuration option has been deprecated. Can be safely deleted. 💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 6.2.0 @capacitor/core: 6.2.0 @capacitor/android: 6.2.0 @capacitor/ios: 6.2.0

Installed Dependencies:

@capacitor/cli: 6.2.0 @capacitor/core: 6.2.0 @capacitor/android: 6.2.0 @capacitor/ios: 6.1.2

[success] Android looking great! 👌

Other API Details

npm --version
10.9.0

node --version
v22.11.0

Platforms Affected

  • [ ] iOS
  • [X] Android
  • [ ] Web

Current Behavior

When versionCode and versionName are omitted from build.gradle, Capacitor crashes on subsequent dev runs (after initial app install on device).

(versionCode and versionName are omitted in my project for dev builds. They are only added/controlled by CI.)

To reproduce:

  • Clone/install app
  • Run capacitor for android - npx cap open android
  • Ctrl+R to run on phone
  • Observe success
  • Ctrl+R again to update/run on phone
  • Observe crash
  • Observe crash on any further update until app is deleted from device, in which case first install will succeed again.

Expected Behavior

No crash

Project Reproduction

https://github.com/aeharding/cap-crash-test

Additional Information

No response

aeharding avatar Dec 12 '24 18:12 aeharding