Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:Execution failed for task ':android:transformClassesAndResourcesWithProguardForRelease'

Every time I am getting this error when running my project. I can do a Clean and then Run again, and it works. But it is not an optimal solution. Any ideas?

Error:Execution failed for task ':android:transformClassesAndResourcesWithProguardForRelease'.

java.io.IOException: Failed to rename android\build\intermediates\transforms\proguard\release\folders\3\1f\main\classes.jar to android\build\intermediates\transforms\proguard\release\jars\3\1f\classes.jar

like image 399
Z0q Avatar asked Nov 23 '15 17:11

Z0q


4 Answers

This bug happens when the versions of SDK, Build Tools and Gradle Plugins doesn't match (in terms of compatibility). The solution is to verify if you are using the latest versions of them. The gradle plugins are placed in the build.gradle file of the project. Other versions are in the build.gradle file of the module. For example, for SDK 23, you must use the Build Tools 23.0.1 and gradle plugins version 1.3.1.

Clean the project after changing settings. (Solved my problem, and never seen it again.)

refer this question

like image 183
Blue_Alien Avatar answered Nov 15 '22 13:11

Blue_Alien


Remove lines from proguard-rules.txt that contains:

-injars, -outjars, or -libraryjars

and rebuild.

like image 4
user1367713 Avatar answered Nov 15 '22 12:11

user1367713


in my case it was okhttp proguard rules after adding them it worked fine

#OKhttp RULES START
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn javax.annotation.**
#OKhttp RULES END

#picasso rules START
-dontwarn com.squareup.okhttp.**
#picasso rules END
like image 1
Mateen Chaudhry Avatar answered Nov 15 '22 12:11

Mateen Chaudhry


Removing minifyEnabled true from release config worked for me.

like image 1
Sabri Meviş Avatar answered Nov 15 '22 14:11

Sabri Meviş