Android issue highlights forty-seven: Error: Execution failed for task & #39;: app: packageRelease & #39;.) Unable to compute hash
The jna-related warnings are listed above when you encounter this problem during obfuscation compiling when using the jna jar package.
You need to develop compilation rules in the proguard-rules.pro to ignore the jna-related package warnings.
-keep class com.sun.jna.** { *; }-dontwarn com.sun.jna.**
Note that if it is introduced as a module, You need to ignore it in the proguard-rules.pro file in the main app.
The original article is as follows:
All the current answers to this question are just giving the Proguard rules that worked for them, every fix will be different. first off, confirm it's a Proguard problem by checking that the classes-proguard directory is somewhere in the error message, something like this: unable to compute hash of/Users/Documents/projectX/app/build/intermediates/classes-proguard/release/classes. jar
This means it's caused by an earlier Proguard error so you need to scroll up in the Messages window or Gradle Console window and check what warnings or errors you're getting. just as an example, in my current project, Square's Picasso library is causing the error: Warning: com. squareup. picasso. okHttpDownloader: can't find referenced class com. squareup. okhttp. okHttpClient. I just added-dontwarn com. squareup. okhttp. ** to ignore the warnings, and the app still worked as normal.
A lot of the Proguard errors will be warnings about some class so just adding-dontwarn for whatever class is causing it in your project often works.