Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:Execution failed for task ':app:packageRelease'.> Unable to compute hash of ..\app\build\intermediates\classes-proguard\..\release\classes.jar

I am getting the following error message when I enable Proguard from gradle file and to generate an release build file.

Exception while processing task java.io.IOException: proguard.ParseException: Expecting type and name instead of just '' before '(' in line 169 of file 'S:\workspace\Projects..\app\build\intermediates\proguard-rules..\release\aapt_rules.txt' at com.android.build.gradle.tasks.AndroidProGuardTask$1.run(AndroidProGuardTask.java:117) at com.android.builder.tasks.Job.runTask(Job.java:48) at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41) at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:227) at java.lang.Thread.run(Thread.java:745) Error:proguard.ParseException: Expecting type and name instead of just '' before '(' in line 169 of file 'S:\workspace\Projects..\app\build\intermediates\proguard-rules..\release\aapt_rules.txt' at proguard.ConfigurationParser.parseMemberSpecificationArguments(ConfigurationParser.java:908) at proguard.ConfigurationParser.parseClassSpecificationArguments(ConfigurationParser.java:748) at proguard.ConfigurationParser.parseKeepClassSpecificationArguments(ConfigurationParser.java:534) at proguard.ConfigurationParser.parse(ConfigurationParser.java:165) at proguard.gradle.ProGuardTask.getConfiguration(ProGuardTask.java:1142) at proguard.gradle.ProGuardTask.proguard(ProGuardTask.java:1074) at com.android.build.gradle.tasks.AndroidProGuardTask.doMinification(AndroidProGuardTask.java:139) at com.android.build.gradle.tasks.AndroidProGuardTask$1.run(AndroidProGuardTask.java:115) ... 4 more Error:Execution failed for task ':app:packageProRelease'. > Unable to compute hash of S:\workspace\Projects\app\build\intermediates\classes-proguard\Pro\release\classes.jar

I am using following libraries in the code:

  1. AndroidScanLib.jar
  2. apache-mime4j-core-0.7.jar
  3. httpclient-4.1.2.jar
  4. httpmime-4.2.3.jar
  5. libGoogleAnalyticsServices.jar
  6. MobileImagingEngine.jar
  7. MobileImagingEngine_Doc.jar
  8. SmartScan.jar
  9. sqlcipher.jar
like image 412
Anshul Avatar asked Sep 03 '15 08:09

Anshul


2 Answers

A weird workaround: disable minifyEnabled (minifyEnabled false), generate signed APK, and then re-enable it (minifyEnabled true) and generate the signed APK again. Hope this works.

like image 99
Sai Avatar answered Nov 20 '22 22:11

Sai


In my case i was using a custom library that i created and i had set minifyEnabled true, and in the dependent module i again did same minifyEnabled true. keeping this at only one place solved my problem. Same can be case with libraries other than your own!

like image 39
Uzair Avatar answered Nov 20 '22 22:11

Uzair