fix: enable code shrinking and add ProGuard rules for ML Kit text recognition
This commit is contained in:
parent
91f25e0cef
commit
f62eb9f288
2 changed files with 13 additions and 0 deletions
|
|
@ -35,6 +35,12 @@ android {
|
|||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
7
android/app/proguard-rules.pro
vendored
Normal file
7
android/app/proguard-rules.pro
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Google ML Kit text recognition — keep all script-specific recognizer classes
|
||||
-keep class com.google.mlkit.vision.text.** { *; }
|
||||
-keep class com.google.mlkit.vision.text.chinese.** { *; }
|
||||
-keep class com.google.mlkit.vision.text.devanagari.** { *; }
|
||||
-keep class com.google.mlkit.vision.text.japanese.** { *; }
|
||||
-keep class com.google.mlkit.vision.text.korean.** { *; }
|
||||
-dontwarn com.google.mlkit.vision.text.**
|
||||
Loading…
Reference in a new issue