fix(android): add ProGuard rules to suppress HMS missing class errors
R8 fails on missing optional HMS dependencies (HiAnalytics, libcore, BouncyCastle). Add dontwarn rules and wire proguard-rules.pro to release build type. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
62f1a88557
commit
61e7533d64
|
|
@ -79,6 +79,11 @@ android {
|
||||||
// TODO: Add your own signing config for the release build.
|
// TODO: Add your own signing config for the release build.
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||||
signingConfig = signingConfigs.getByName("debug")
|
signingConfig = signingConfigs.getByName("debug")
|
||||||
|
isMinifyEnabled = true
|
||||||
|
proguardFiles(
|
||||||
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
|
"proguard-rules.pro"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
# Flutter
|
||||||
|
-keep class io.flutter.app.** { *; }
|
||||||
|
-keep class io.flutter.plugin.** { *; }
|
||||||
|
-keep class io.flutter.util.** { *; }
|
||||||
|
-keep class io.flutter.view.** { *; }
|
||||||
|
-keep class io.flutter.** { *; }
|
||||||
|
-keep class io.flutter.plugins.** { *; }
|
||||||
|
|
||||||
|
# Huawei HMS — optional internal classes not bundled in the app
|
||||||
|
-dontwarn com.huawei.android.os.**
|
||||||
|
-dontwarn com.huawei.hianalytics.**
|
||||||
|
-dontwarn com.huawei.hms.availableupdate.**
|
||||||
|
-dontwarn com.huawei.libcore.io.**
|
||||||
|
-dontwarn com.huawei.secure.android.**
|
||||||
|
|
||||||
|
# BouncyCastle — referenced by HMS security but not shipped
|
||||||
|
-dontwarn org.bouncycastle.**
|
||||||
Loading…
Reference in New Issue