Reputation: 3437
I am unable to generate a signed APK for my app, I am stuck with the error java.io.IOException Execution failed for task:'app:proguardRelease' I have what I think is a basic gradle file see below
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.okason.clients"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.api-client:google-api-client:1.19.0'
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
}
The generated Proguard-rules.pro file is empty amd I have not touched the proguard-android.txt file in the SDK. I even tried to copy this file to the root of app to be the same location as the app.gradle file without success.
I tried to run this command gradlew.bat assembleRelease per this [SO Question][1]
with success. Please can someone take a look and let me know what I am doing wrong. I have update the SDK and Android Studio to the latest versions.
Upvotes: 10
Views: 18781
Reputation: 1493
I think Sir you can avoid the error without turning off the Proguard. Check this answer by Sir Eric Schlenz with regards to this issue. In order to just get to a point where the build would get through proguard, You have to add -dontwarn
entries for packages it was complaining about to your proguard-project.txt
file.
Upvotes: 3
Reputation: 3437
Solved the problem by setting minifyEnabled true to minifyEnabled false in the app.gradle file
Upvotes: 2