Gradle says deprecated features were used and the build will break on the next major version
Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.Short answer
This is a warning, not a failure. Gradle prints it when your build scripts or plugins call APIs that a future major version will remove. Re-run with --warning-mode all to see each call, update the plugins that trigger it, then move the wrapper up. Fix the listed items before you upgrade, not after.
Fix it fast
1Find out which cause you have
The summary hides the details. Run any task with all warnings switched on and read which script or plugin each warning names.
./gradlew help --warning-mode all2Match what you see, then jump to its fix
- 1
The warning text names a plugin or says 'This behavior has been deprecated' with a stack frame inside a pluginA plugin you use still calls the old APIFix - 2
The warning points to a line in build.gradle, settings.gradle or a script pluginYour own build script uses removed or deprecated callsFix - 3
The warning is the only message and the build otherwise passesYou want to move the wrapper to the next major versionFix
- 1
What does the error look like?
Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
Cause 1 of 3
A plugin you use still calls the old API
1Check
Print every deprecation. A warning whose stack points into a plugin jar (not your build.gradle) is a plugin problem, and only a newer plugin version fixes it.
./gradlew build --warning-mode all2Fix
Raise the plugin to its latest release, starting with the Android Gradle plugin and the Kotlin plugin. The Gradle upgrade guide says to update plugins first, because newer versions are more likely to support the next Gradle.
# gradle/libs.versions.toml
[versions]
agp = "8.13.0" # use the newest AGP your Android Studio supports3Verify
Run the same command again and confirm the warning list is shorter or gone.
./gradlew help --warning-mode allConfirmed by docs.gradle.org
Cause 2 of 3
Your own build script uses removed or deprecated calls
1Check
In Gradle 9, items such as jcenter(), Project.exec and the Convention API are removed. The upgrade guide lists each removed item with its replacement.
grep -rn "jcenter()" --include=*.gradle --include=*.kts .2Fix
Replace each call with the replacement the guide names. For example, use mavenCentral() instead of jcenter().
repositories {
google()
mavenCentral()
}3Verify
Run a clean build with warnings set to fail, so any leftover deprecation stops the build.
./gradlew clean build --warning-mode failConfirmed by docs.gradle.org
Cause 3 of 3
You want to move the wrapper to the next major version
1Check
Read the wrapper version first. Then clear the warnings on the current version before changing it.
./gradlew --version2Fix
Update the wrapper with the wrapper task. Run it twice, because the first run only changes gradle-wrapper.properties and the second updates the JAR and scripts.
./gradlew :wrapper --gradle-version 9.0.0
./gradlew :wrapper3Verify
Confirm the new version and run the build.
./gradlew --version
./gradlew buildConfirmed by docs.gradle.org
How do I stop it coming back?
- Run CI with --warning-mode all so new deprecations show up the week they appear.
- Update the Android Gradle plugin and Kotlin plugin together, not one at a time.
- Upgrade Gradle one major version at a time and fix the warnings before each step.
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
Gradle cannot find the compile() method in build.gradle
Could not find method testCompile() for arguments
Gradle 7 removed the compile and runtime configurations, so a dependencies block that still says compile fails.
2 causes, each with a fixMobile 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 fix