I am unable to generate Signed APK using minifyEnabled true
and shrinkResources true
App Level : build.gradle
buildscript {
Maybe one of your libraries (especially libraries which can use networking(httpClient
, okHttp
etc)) conflicts.. Try adding all of your libraries to a new project(do not add any code or component to your project).. If error occurs in that project too so the problem is in one of the libraries.. Try to uncomment libraries one by one..
First check whether you really need to use shrinkResources
If so, do as suggested in developers link https://developer.android.com/studio/build/shrink-code.html#shrink-resources mentioned above by IntelliJ Amiya, you have to use like below
android { buildTypes { release { shrinkResources true // -- always add this above minifyEnabled -- minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } }
Try to generate signed APK using terminal by gradle command see your stack trace that will give you detailed log where has the problem.
In Windows
$gradle clean
$ gradle --stacktrace assembleRelease
In Ubuntu
$./gradlew clean
$./gradlew --stacktrace assembleRelease
if you have still problem post you stack trace here