Lemon
Lemon

Reputation: 487

Unable to compute hash of

When I use minifyEnabled true shrinkResources true gradle task failed with an exception `Execution failed for task ':xxxx:packageRelease'.

Unable to compute hash of D:\asspace\xxxx\xxxx\build\intermediates\classes-proguard\release\classes.jar `

Upvotes: 15

Views: 9042

Answers (3)

Georgi Koemdzhiev
Georgi Koemdzhiev

Reputation: 11931

This fixed the problem for me: add those to the Proguard:

-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.

Upvotes: 6

SILINIK
SILINIK

Reputation: 998

Please, read warnings in console carefully. I`ve also faced with similar issue and in my case there were warnings about processing one of third party libraries. After applying corresponding changes related with the library to proguard file, all started to work correctly

Upvotes: 9

WindsurferOak
WindsurferOak

Reputation: 4907

I had this same issue. For me, my project's proguard file, namely, proguard-rules.pro, was somehow renamed to proguard-android.txt.

The proguard-android.txt is reserved for Android's default proguard rules, so essentially, I was overriding Android's proguard file, which was causing havoc, and I would get the Unable to compute hash message.

Once I changed the filename in my project from proguard-android.txt to proguard-rules.pro I was able to get things working.

Upvotes: 4

Related Questions