Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Publish an Android App Publishing on Google Play Building a Release-Ready APK

Problems with Proguard?

Error:Execution failed for task ':app:proguardRelease'.
> java.io.IOException: Please correct the above warnings first.

Proguard refuses to build my release APK for some reason. Everything is set as it was in the video. Here it is...

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.example.kevin.ribbit"
        minSdkVersion 15
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.android.support:support-v13:20.0.0'
    compile files('libs/commons-io-2.4.jar')
    compile files('libs/picasso-2.3.4.jar')
    compile files('libs/Parse-1.5.1.jar')
}

proguard-rules.pro

# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\Kevin\AppData\Local\Android\android-studio\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}


-assumenosideeffects class android.util.Log {
    public static boolean isLoggable(java.lang.String, int);
    public static int v(...);
    public static int i(...);
    public static int w(...);
    public static int d(...);
    public static int e(...);
}
Paul Assiaw
Paul Assiaw
887 Points

I have the same problem. Any help will appreciated

6 Answers

Ivan Koch
Ivan Koch
22,817 Points

Im having the same problem here.

:app:proguardRelease FAILED Executon failed for task ':app:proguardRelease'. > java.io.IOException: Please correct the above warning first

thanks !!

Me too, in which file should the "-dontwarn" be added?

Were you guys able to solve it? I have the same problem.

Thanks in advance.

Ishay Frenkel
Ishay Frenkel
1,620 Points

Have you tried changing runProguard to minifyEnabled?

Carlos Iribar
Carlos Iribar
5,296 Points

I changed runProguard true to false and generated the APK. After that I changed to runProguard false to true and Sync again

This work for me!!

Roman Kozak
Roman Kozak
3,119 Points

I have the exact same problem. Very annoying.

Ishay Frenkel
Ishay Frenkel
1,620 Points

That is not an answer, if you want to say you have the same problem comment it instead of posting it as an answer, also, if you don't provide any more details, that is pretty unnecessary anyway.