diff --git a/app/android/app/build.gradle b/app/android/app/build.gradle index fd6c55f..8830954 100644 --- a/app/android/app/build.gradle +++ b/app/android/app/build.gradle @@ -24,9 +24,13 @@ android { applicationIdSuffix ".test" versionNameSuffix "-test" } + // R8 shrinks and optimizes the native part (Google Play asks for it). Capacitor's own rules + // keep every plugin class, which the bridge finds by reflection. The mapping file goes into + // the app bundle, so Play shows crash reports with the real class and method names. release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + minifyEnabled true + shrinkResources true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } // On Codemagic the upload key comes in through these variables (codemagic.yaml); without them, diff --git a/app/android/app/proguard-rules.pro b/app/android/app/proguard-rules.pro index f1b4245..f31e3fe 100644 --- a/app/android/app/proguard-rules.pro +++ b/app/android/app/proguard-rules.pro @@ -14,8 +14,8 @@ # Uncomment this to preserve the line number information for # debugging stack traces. -#-keepattributes SourceFile,LineNumberTable +-keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile +-renamesourcefileattribute SourceFile diff --git a/app/android/app/src/main/AndroidManifest.xml b/app/android/app/src/main/AndroidManifest.xml index 16bf6d2..c7bdf5e 100644 --- a/app/android/app/src/main/AndroidManifest.xml +++ b/app/android/app/src/main/AndroidManifest.xml @@ -13,6 +13,9 @@ +