I am using Android Studio 1.2.2 and tried to generate APK with proguard setting. But I can't do it and got below error message.
"Execution failed for task ':packageRelease'.
Unable to compute hash of /Users/Documents/projectX/app/build/intermediates/classes-proguard/release/classes.jar "
The proguard setting is just simple.
-dontshrink
-dontoptimize
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
And the gradle file is below.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion "Google Inc.:Google APIs:22"
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.bientus.cirque.sansotong"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
// multiDexEnabled true
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled true
//proguardFiles 'proguard-project.txt', 'proguard.cfg'
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt', 'proguard.cfg'
proguardFiles 'proguard-project.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile "com.google.android.gms:play-services:7.5.0"
// compile 'com.android.support:multidex:1.0.0'
}
buildscript {
repositories {
// mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
Can anybody give any idea or thought? Thank you very much!
I had the problem too and the best way to solve it is: Go to the gradle console and see where there is a warning e.g
Now open the proguard rules file and scroll to the bottom and add the line
For any missing classes that you find on the gradle console you basically add the line
Hope this works for everyone too. Good luck!