Issue with Android Release Builds crashing immediately on device

Hi I am seeing issues today with release builds. The Build completes successfully, however when I load it on my device it opens and immediately closes, with an error saying the application crashed. The same code with release set to Debug builds and loads on the device Fine.

Also of note the same code was tested a few weeks ago with the release flag and there where no issues.

Is there been an update to the cordova or Gradle version in the last few weeks? If so wouldn’t it be the same for both debug and release builds?

Thanks

We’ve not made any major updates in the last few weeks. Can you tell me what date things were working OK for you?

I have a release build from Feb 16th with the same code, that works great. I also have the corresponding zip package that I did the build from.

I just tried the same zip package now and I see the same issue, where the application gets installed than immediately crashes. Let me know if you need me to send you the zip package.

Thanks

Which android version is your phone? Did you tested with more than one device?

I would appreciate it if you could DM me the working APK from the 16th as well as the zip you used to produce it. Thanks.

Android 12, yes I have tested on 2 devices. The same devices and android versions as Feb 16th.

I will DM the working APK and zip

Plz if you get this problem solved, say it here

Awaiting your message.

I replied from my email yesterday afternoon with the APK and zip.

Is there a different way you would like me to send that over?

Thanks

No worries - we have it here now.

After a lot more testing locally and with Volt Build, I believe I have found the culprit. I had this plugin set to allow updates to minor versions

plugin name=“cordova-plugin-contacts-x” spec="^2.0.1"

There was a minor update 13 days ago with the plugin.

I switched this plugin to lock in 2.0.1

plugin name=“cordova-plugin-contacts-x” spec="~2.0.1"

And now the release build and loads fine on devices.

Sorry for wasting your time on this.

Always lock in your spec version… this was the only one that allowed the minor update and it caused hours of grief.

Thanks
Joanthan

Thanks for checking back in - when I got your response I had just started looking at your plugins. You might be interested to see this: (bug): App runs fine on device from CLI, but crashes upon launch if installed from PlayStore. · Issue #23 · EinfachHans/cordova-plugin-contacts-x · GitHub

It’s no bother! Glad you got things working again!