Skip to content Skip to sidebar Skip to footer

Build Fails When Targeting Android Q But Works At Api 28 With "failed To Transform File 'android.jar' To Match Attributes"

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 Cal

Solution 1:

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

Solution 2:

Anyone who might be coming here from a google search, I found the answer.

In the release notes for Android Q Beta 2 I found in the release notes this blurb:

When using Gradle 3.2.0 for projects targeting Android Q, you might encounter a lint-related issue with an error message similar to "Could not transform android.jartoa mockable jar." This issue does not occur in Gradle 3.3.0 and later.

If you are working on an app that targets Android Q and are unable to upgrade to Gradle 3.3.0 or later, you can use one of the following workarounds:

  - Disable lint for release builds
  - Unzip and rezip android.jar

Sure enough, unzipping and rezipping the android.jar allowed me to build and deploy to my test Android Q device

Solution 3:

Go to Tools>SDK manager>platform tools and install/update SDK platform tools for Android Q. You might need to delete the existing sdk platform tools for Android Q and reinstall

Post a Comment for "Build Fails When Targeting Android Q But Works At Api 28 With "failed To Transform File 'android.jar' To Match Attributes""