Gradle sync complains about AndroidX dependencies or old support libraries
This project uses AndroidX dependenciesShort answer
The project mixes AndroidX with the old Support Library. Make sure gradle.properties enables android.useAndroidX on AGP 8 and older, replace every com.android.support artifact with its androidx or Material equivalent, and turn on android.enableJetifier only when a third-party library you cannot update still uses the old packages.
Fix it fast
1Find out which cause you have
Open gradle.properties in the project root and look for the two AndroidX flags, then list any leftover support-library lines in your build files.
cat gradle.properties grep -rn "com.android.support" --include=*.gradle --include=*.kts .2Match what you see, then jump to its fix
- 1
The sync message names AndroidX dependencies while gradle.properties has no android.useAndroidX line, or has it set to false.android.useAndroidX is missing or falseFix - 2
Lines such as com.android.support:appcompat-v7 or com.android.support:design remain in the dependencies block, and imports still start with android.support.Old com.android.support libraries are still declaredFix - 3
Your own code is clean, but a dependency still references android.support classes.A third-party library still ships the old support packagesFix
- 1
What does the error look like?
This project uses AndroidX dependenciesandroid.useAndroidXAndroid design support library not working after targeting API 28
Cause 1 of 3
android.useAndroidX is missing or false
1Check
The AndroidX overview says the flag is true by default only from Android Gradle Plugin 9.0.0; earlier versions default to false. Check which plugin version the project uses.
grep -n "useAndroidX" gradle.properties
grep -rn "com.android.application" --include=*.gradle --include=*.kts --include=*.toml .2Fix
Add the flag to gradle.properties. The page also notes that the ability to set it to false is planned for removal in AGP 10, so do not set false.
# gradle.properties
android.useAndroidX=true3Verify
Sync the project again (File, Sync Project with Gradle Files) or run a build.
./gradlew assembleDebugConfirmed by developer.android.com
Cause 2 of 3
Old com.android.support libraries are still declared
1Check
Support Library 28.0.0 was the last release, so nothing newer is published under that name. Search for every old coordinate.
grep -rn "com.android.support" --include=*.gradle --include=*.kts .2Fix
Replace each artifact with its mapped AndroidX one. The mapping table lists appcompat-v7 as androidx.appcompat:appcompat and the design library as com.google.android.material:material. Then change the imports in your code to match.
dependencies {
// before: implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:<version>'
// before: implementation 'com.android.support:design:28.0.0'
implementation 'com.google.android.material:material:<version>'
}3Verify
No old coordinate is left and the build passes.
grep -rn "com.android.support" --include=*.gradle --include=*.kts . || echo "none left"
./gradlew assembleDebugConfirmed by developer.android.com
Cause 3 of 3
A third-party library still ships the old support packages
1Check
Print the dependency tree and see which library pulls in the support artifacts.
./gradlew :app:dependencies --configuration debugRuntimeClasspath2Fix
Update the library first; most of the ecosystem is already AndroidX. If you cannot, turn on Jetifier, which rewrites third-party binaries to AndroidX. The docs say it is false by default, planned for removal in AGP 10, and that it can slow builds, so remove it once the library is updated.
# gradle.properties
android.useAndroidX=true
android.enableJetifier=true3Verify
Build again and then try removing the Jetifier line once the library is updated.
./gradlew clean assembleDebugConfirmed by developer.android.com
How do I stop it coming back?
- Keep dependencies on AndroidX and Material artifacts only; the Support Library has no releases after 28.0.0.
- Treat android.enableJetifier=true as a temporary bridge and re-test without it when you update libraries.
- Use a version catalog so one artifact name is declared once.
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