Gradle failed to build when proguard is activated

Solution 1:

I've been battling this issue for the past few hours. Basically the proguard task will halt execution if there are any warnings. You can see the Proguard warnings, and the stacktrace, by adding -d to the build (as in: gradle clean assembleRelease -d). Note that the stacktrace mentions to "Please correct the above warnings first."

In order to just get to a point where the build would get through proguard, I had to add -dontwarn entries for packages it was complaining about to my proguard-project.txt file. Something along the lines of:

-dontwarn org.apache.lang.**

...etc

So put simply... do as the stacktrace instructs you to do. Fix the warnings! :)

BTW, I apologize, as I now recognize that the stacktrace in the original post is not quite the same as the one I encountered. However, I do feel my answer is helpful, as obviously I ended up here trying to search for answers to my issue.

Solution 2:

Hmmm, I don't understand why but it seems if I start two times the same task with the same parameters (proguard...) the second one is the good one.

But if the second one the parameters change, the task fail.

Hope it will help someone.

Regards