Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Gradle fails to transform an .aar with JetifyTransform

ErrorFailed to transform some-lib-release.aar to match attributes {artifactType=processed-aar} using transform JetifyTransform

Short answer

JetifyTransform only runs when android.enableJetifier is true. Most libraries now ship AndroidX natively, so the usual fix is to turn the flag off and let the build run without it. If a library really still uses the old Support Library, replace it with its AndroidX artifact instead.

  • Applies to Android Gradle plugin 8.x, Android Gradle plugin 9, Android Studio
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    See whether the project asks for Jetifier at all. If the flag is not set, JetifyTransform is not your cause.

    grep -rn "enableJetifier\|useAndroidX" gradle.properties
  2. 2Match what you see, then jump to its fix

    1. 1android.enableJetifier=true in gradle.properties, and the failing .aar is a recent libraryJetifier is enabled but nothing in the project needs itFix
    2. 2The build breaks with Jetifier off, naming android.support classesA dependency still uses the old Support LibraryFix

What does the error look like?

  • Failed to transform some-lib-release.aar to match attributes {artifactType=processed-aar} using transform JetifyTransform
  • The build fails soon after adding a library that comes as an .aar file

Cause 1 of 2

Jetifier is enabled but nothing in the project needs it

1Check

The AndroidX migration guide says most libraries support AndroidX natively, that enableJetifier slows builds, and that it should not be used unless necessary. Android Studio's Build Analyzer has a Jetifier check that tells you whether it is still needed (Android Studio Chipmunk and later).

# After a build, open the Build Analyzer window in Android Studio and read its Jetifier check

2Fix

Turn the flag off in gradle.properties, then sync.

android.useAndroidX=true
android.enableJetifier=false

3Verify

Build again; the transform step no longer runs for that library.

./gradlew assembleDebug

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 2

A dependency still uses the old Support Library

1Check

Jetifier exists to rewrite old Support Library references. If turning it off exposes android.support classes, the library behind them has not moved to AndroidX.

./gradlew :app:dependencies --configuration debugRuntimeClasspath | grep -i support

2Fix

Update that library to a version that ships AndroidX. If none exists, use the artifact and class mapping tables from the migration guide to replace the old dependency, and keep Jetifier on only until you do.

# Replace the old artifact with its AndroidX mapping from the migration guide's tables

3Verify

The dependency tree has no android.support entries and the build passes with Jetifier off.

./gradlew assembleDebug

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Do not copy android.enableJetifier=true from old tutorials into new projects.
  • Re-run the Build Analyzer Jetifier check after dependency updates.
  • Work on the migration in a separate branch, as the migration guide advises.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Mobile apps

adb tcpip 5555 fails because no device is found

adb: more than one device/emulator

adb tcpip only works while the device is attached and listed by adb, because it tells the phone to start listening on port 5555.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.