buildTypes { release { minifyEnabled true shrinkResources = true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } debug { debuggable true testCoverageEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt') , 'proguard-rules.pro' } }
我也面临同样的问题 minifyEnabled true shrinkResources = true
fun updateImage(context: Context, imageName: String, imageView: ImageView) {
if (imageView.tag?.equals(imageName.lowercase()) != true) {
imageView.setImageDrawable(
ContextCompat.getDrawable(
context,
context.resources.getIdentifier(
imageName.lowercase(),
"drawable",
context.packageName
)
)
)
imageView.tag =
context.resources.getIdentifier(
imageName.lowercase(),
"drawable",
context.packageName
)
}
}
我们怎样才能解决这个问题。?