When i try to do minify enabled true in my build.gradle file using below code application is crashed :
Code
buildTypes {
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug{
debuggable true
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
- when I did: minifyEnabled true after building release apk: app-release.apk, the app crashed.
- when I did: minifyEnabled false after building release apk: app-release.apk, the build is okay.
As indicated ref resource, minifyEnabled will remove unused codes. In your situation, there might be methods which is used with JNI or else and compiler did not known it's used. Again according to ref, you can specify which files to keep from examination of built-in minify (same as proguard). The answer is here