IanWambai / Chowder

Chowder for Android M-Pesa payments.
MIT License
30 stars 25 forks source link

Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. #13

Closed IanWambai closed 7 years ago

IanWambai commented 7 years ago

Trying to build a release apk leads to this error. There are also quite a few warnings spanning various dependency packages like this: Warning:okio.Okio: can't find referenced class java.nio.file.Path

IanWambai commented 7 years ago

Not really sure it's because of Chowder, but it might be. In the process of debugging.

IanWambai commented 7 years ago

From Stack Overflow, here's what's causing this issue:

..you have dependencies on libraries that rely on parts of the Java Runtime (rt.jar) but are not part of Android's runtime (android.jar), hence the warnings you get from ProGuard.

I was able to fix this by telling ProGuard to ignore the warnings. I got a successful build of the release apk, which installed and ran fine.

To be clear, this isn't a bug in Chowder, it's a feature in ProGuard.

In your proguard-rules.pro add this (you can edit it to have only the packages you get warnings for):

-dontwarn com.roughike.bottombar.**
-dontwarn org.jaxen.**
-dontwarn org.w3c.dom.**
-dontwarn okio.**
-dontwarn io.codetail.**
-dontwarn retrofit2.**