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 trialKevin Haube
12,265 PointsProblems 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(...);
}
6 Answers
Ivan Koch
22,817 PointsIm having the same problem here.
:app:proguardRelease FAILED Executon failed for task ':app:proguardRelease'. > java.io.IOException: Please correct the above warning first
thanks !!
Paul Anton
3,548 PointsMe too, in which file should the "-dontwarn" be added?
Unsubscribed User
6,718 PointsWere you guys able to solve it? I have the same problem.
Thanks in advance.
Ishay Frenkel
1,620 PointsHave you tried changing runProguard
to minifyEnabled
?
Carlos Iribar
5,296 PointsI 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
3,119 PointsI have the exact same problem. Very annoying.
Ishay Frenkel
1,620 PointsThat 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.
Paul Assiaw
887 PointsPaul Assiaw
887 PointsI have the same problem. Any help will appreciated