Shahidul
Shahidul

Reputation: 3037

Execution failed for task ':app:mockableAndroidJar'

I am using local gradle of version 2.4 and IntelliJ IDEA 14.1.3 When I run project from IntelliJ it runs fine but when execute gradle clean build command from command line it gives the flowing exception and build fails.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mockableAndroidJar'.
> java.util.zip.ZipException: invalid entry compressed size (expected 2051 but got 2050 bytes)

Upvotes: 6

Views: 4783

Answers (2)

LAS
LAS

Reputation: 11

I solved it by changing com.android.tools.build:gradle:2.3.0 version to 2.2.3, then build it with another exception and then I changed the version back to 2.3.0.

Not sure how it works, looks like a gradle bug.

Upvotes: 1

Maniya Joe
Maniya Joe

Reputation: 801

This looks like an old ques which is not yet answered yet. I got into same problem, when my jar files could not be read by Android Studio and it gave me the above mentioned error.

Taking lead from the comment by -Mikhail Boyarsky I changed classpath in build.gradle file to 'com.android.tools.build:gradle:2.2.3'. Synced project and it started working.

Upvotes: 1

Related Questions