3

When I started to build against API 23 of Android, gradle plugin 1.3.1, gradle 2.7, I can't generate the APK any more. Maybe something with ProGuard but I don't understand what it is. I've looked at a lot of similar problems here at stackoverflow but can't find the solution.

Error:Execution failed for task ':MyApp:packageDebug'.
> Unable to compute hash of D:\Android\Projects\xxx\xxx\build\intermediates\classes-proguard\debug\classes.jar

I also have warnings that I don't understand what they mean. These are a few:

Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages

and

    Warning:com.google.api.client.testing.http.apache.MockHttpClient$1: can't find referenced class org.apache.http.HttpRequest

Warning:com.google.api.client.testing.http.apache.MockHttpClient$1: can't find referenced class org.apache.http.protocol.HttpContext
Warning:there were 166 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning:there were 3 unresolved references to program class members.
         Your input classes appear to be inconsistent.
         You may need to recompile the code.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)

I think it's these libraries that uses httpclient

compile ('com.google.apis:google-api-services-drive:v2-rev186-1.20.0')
    compile ('com.google.api-client:google-api-client:1.20.0')
    compile ('com.google.api-client:google-api-client-android:1.20.0')
    compile ('com.google.api-client:google-api-client-gson:1.20.0')
    compile ('com.google.oauth-client:google-oauth-client:1.20.0')
    compile ('com.google.code.gson:gson:2.3.1')
    compile ('com.google.http-client:google-http-client:1.20.0')
    compile ('com.google.http-client:google-http-client-android:1.20.0')
    compile ('com.google.http-client:google-http-client-gson:1.20.0')

I've tried to add

{
    exclude module: 'httpclient' //by artifact name
    exclude group: 'org.apache.httpcomponents' //by group
    exclude group: 'org.apache.httpcomponents', module: 'httpclient' //by both name and group
}

as well as

useLibrary 'org.apache.http.legacy'

and

-dontwarn org.apache.http.**
-dontwarn org.apache.lang.**
-dontwarn android.net.http.AndroidHttpClient

but I can't get it to compile. Please help! :/

Thanks for any ideas!

Mackan
  • 1,305
  • 2
  • 17
  • 30
  • Possible duplicate of [Error:Execution failed for task ':app:packageRelease'. > Unable to compute hash of /../AndroidStudioProjects/../classes.jar](http://stackoverflow.com/questions/31643339/errorexecution-failed-for-task-apppackagerelease-unable-to-compute-hash) – blahdiblah Nov 03 '16 at 01:30

0 Answers0