Issues in release build when minifyEnabled is set to true
See original GitHub issueCapacitor version
1.0.0-beta.4
Platform
Android
Issue
Strangely, many Capacitor elements behave differently in release build.
For instance, with debug we don’t have any issues, while release builds getting few crashes during testing all the time:

For instance, my friend’s Galaxy S6 Android 6.0 (debloated, not stock) always crashing on launch with release version, but not with debug.
Another issue with navigator.geolocation described in #738
And we noticed that for some reason Plugins.App.openUrl stops to work in release version. It just doing nothing.
I’m sure there also other issues specific to the release build. It makes me feel there some kind of global issue with release build in Capacitor.
What can I do to help debug those issues?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:27 (10 by maintainers)
Top Results From Across the Web
minifyEnabled causing app to crash on release mode
If the crash of the app happens, then you need to configure ProGuard. Concrete configuration depends on your project and its dependencies. Every...
Read more >App crashes with minifyEnabled true [37114347] - Issue Tracker
Apologies, you'll need to edit the gradle script to set minifyEnabled to true and make sure to build the release variant. (I just...
Read more >Importance of Proguard for the Android platform and its ...
Sometimes the app crashes in release build even when the app is running fine in debug build. It might be an issue with...
Read more >Azure Spatial Anchors Android NDK lib fails to load when ...
To reproduce change "minifyEnabled false" to "minifyEnabled true" or ... In Android Studio select build variant release, configure signing.
Read more >[Help]Problem with minifyEnabled when set true : r/androiddev
Since I improved my application, whenever I enable the minifyEnabled on the gradle settings, my application crashes on start. I made several changes....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Here my
proguard-rules.proconfiguration which seems to ensure that any plugin is preserved during minification (tested with plugins: byteowls-capacitor-oauth2, capacitor-fcm, capacitor-secure-storage-plugin and those of capacitor-android):It could be put here and, as an embedded library proguard file, should be handled by any android/capacitor project.
Maybe it could be optimized but it does the job for me 😄!
Hi @hschindler
Native api in capacitor has changed. For Capacitor v3 (ionic and angular version does not matter) with
minifyEnabled truewe should write inproguard-rules.pro:EDIT: Added directives for permissions and activities result:
If older (v2) plugins are present, this also should be added:
And, if Cordova plugins are still present:
Tested on fresh project created with ionic cli with Capacitor v3, angular v12 and ionic v5