Complete the code to enable ProGuard for app size optimization in the build.gradle file.
android {
buildTypes {
release {
minifyEnabled = [1]
}
}
}Setting minifyEnabled to true enables code shrinking and obfuscation, which helps reduce app size.
Complete the code to exclude unused resources during build to reduce app size.
android {
buildTypes {
release {
shrinkResources = [1]
}
}
}Setting shrinkResources to true removes unused resources, helping to reduce app size.
Fix the error in the Kotlin code to load only necessary native libraries to reduce app size.
System.loadLibrary([1])lib prefix or file extension is incorrect.The System.loadLibrary function requires the library name as a string with quotes, without the lib prefix or file extension.
Fill both blanks to configure ABI splits to reduce APK size by targeting specific CPU architectures.
android {
splits {
abi {
enable = [1]
reset()
include [2]
}
}
}Enabling ABI splits with true and including common architectures like armeabi-v7a and arm64-v8a helps reduce APK size by building only for those CPUs.
Fill all three blanks to create a ProGuard rule that keeps only the necessary classes and removes unused code.
-keep class [1] { [2]; } -dontwarn [3]
This ProGuard rule keeps the MainActivity class and all its public members, and suppresses warnings for the Android support library to avoid build errors.