You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: App crashes on Android when minifyEnabled true聽#8587
I've played around with it and the following rules have solved it:
For all related plugin that uses permissions:
-keep @interface com.getcapacitor.**
The following is needed for the camera plugin, let me know if you want me to open a different issue:
# The camera plugin carries its parameters and its results between the app and the editor as gson
# objects, and neither gson nor the ioncamera-android library that uses it ships rules of its own.
# Gson works over these classes by reflection: it needs the fields to still be there to fill them,
# the @SerializedName on each one to know which json key it answers to, and the generic signature
# of a TypeToken to know what it is building - none of which R8 can see is used. These are gson's
# own documented rules.
-keepattributes Signature
-dontwarn sun.misc.**
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
If there's more information you'd like me to check please let me know.
Hey @HarelM thanks for opening the issue! Just wanted to let you know we are aware of Play Store's upcoming requirement for code optimization thresholds, and are looking into Capacitor app minification, including missing proguard rules (on both Capacitor and Plugins).
We have this additional PR with more proguard rules #8657
We also plan to add different rules for specific plugins of ours that need them.
Note: From our tests, we didn't need to add the GSON notes for the camera plugin, but we'll be re-reviewing and testing and if needed we'll add them to the camera plugin.
The additional proguard rules, should be patch releases for Capacitor 8 and respective current plugin versions for Capacitor 8.
The use of AGP 9 and setting minifyEnabled to true by default, will only happen in Capacitor 9, as those are breaking changes.
Activity
[-][Bug]: App crashes on Android when[/-][+][Bug]: App crashes on Android when minifyEnabled true[/+]OS-pedrogustavobilro commentedon Sep 7, 2026
Hey @HarelM thanks for opening the issue! Just wanted to let you know we are aware of Play Store's upcoming requirement for code optimization thresholds, and are looking into Capacitor app minification, including missing proguard rules (on both Capacitor and Plugins).
HarelM commentedon Oct 14, 2026
Nice! Thanks! Which version should support this?
OS-pedrogustavobilro commentedon Oct 14, 2026
We have this additional PR with more proguard rules #8657
We also plan to add different rules for specific plugins of ours that need them.
Note: From our tests, we didn't need to add the GSON notes for the camera plugin, but we'll be re-reviewing and testing and if needed we'll add them to the camera plugin.
The additional proguard rules, should be patch releases for Capacitor 8 and respective current plugin versions for Capacitor 8.
The use of AGP 9 and setting
minifyEnabledtotrueby default, will only happen in Capacitor 9, as those are breaking changes.HarelM commentedon Oct 14, 2026
Thanks for the update, I'll try to remove the rules I added after three next release and open the relevant issue if needed.
HarelM commentedon Oct 18, 2026
Also worth mentioning that if gson is no longer used, it might be worth removing the dependency from there:
https://github.com/ionic-team/capacitor-camera/blob/7e001d43dc219af791bbde40fada8d28511d59d4/android/build.gradle#L95