Gradle fails to transform an .aar with JetifyTransform
Failed to transform some-lib-release.aar to match attributes {artifactType=processed-aar} using transform JetifyTransformShort 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.
Fix it fast
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.properties2Match what you see, then jump to its fix
What does the error look like?
Failed to transform some-lib-release.aar to match attributes {artifactType=processed-aar} using transform JetifyTransformThe 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 check2Fix
Turn the flag off in gradle.properties, then sync.
android.useAndroidX=true
android.enableJetifier=false3Verify
Build again; the transform step no longer runs for that library.
./gradlew assembleDebugConfirmed by developer.android.com
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 support2Fix
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 tables3Verify
The dependency tree has no android.support entries and the build passes with Jetifier off.
./gradlew assembleDebugConfirmed by developer.android.com
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
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile 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 fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fixMobile 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