I've got a legacy app I'm maintaining that builds fine when targeting API 28 but fails at Q.
The full error from the gradle build looks like this:
> Task :lintVitalRelease
Calling mockable JAR artifact transform to create file: /Users/spartygw/.gradle/caches/transforms-1/files-1.1/android.jar/5fe3ee8a258b0a02d9b262c195a9ab63/android.jar with input /Users/spartygw/Library/Android/sdk/platforms/android-Q/android.jar
> Task :lintVitalRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':lintVitalRelease'.
> Could not resolve all files for configuration ':androidApis'.
> Failed to transform file 'android.jar' to match attributes {artifactType=android-mockable-jar, returnDefaultValues=false} using transform MockableJarTransform
> Cannot create mockable android.jar
I've followed the guidelines for setting up the Android Q SDK from here.
I'm building from a command line outside of Android Studio.
I see the build progress through building the jni library but barfs immediately when it gets to java byte compilation.
EDIT: Because I can't include the entire gradle stack (limited to 30,000 bytes in a post) here is the synopsis:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':lintVitalRelease'.
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':androidApis'.
Caused by: org.gradle.api.artifacts.transform.ArtifactTransformException: Failed to transform file 'android.jar' to match attributes {artifactType=android-mockable-jar, returnDefaultValues=false} using transform MockableJarTransform
Caused by: java.lang.RuntimeException: Cannot create mockable android.jar
Caused by: java.util.zip.ZipException: invalid entry compressed size (expected 1821 but got 1807 bytes)
at com.android.builder.testing.MockableJarGenerator.createMockableJar(MockableJarGenerator.java:96)
at com.android.build.gradle.internal.dependency.MockableJarTransform.transform(MockableJarTransform.java:54)
... 109 more
Suppressed: java.util.zip.ZipException: invalid entry compressed size (expected 1821 but got 1807 bytes)
Those of you who are coming through google search and already have the latest gradle installed
Just delete the Android Q SDK and reinstall. The jars from left over beta install is probably messing with the final release
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With