Maaz Zindani

Loading the index…

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

Gradle says deprecated features were used and the build will break on the next major version

ErrorDeprecated 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.

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

Fix it fast

  1. 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 all
  2. 2Match what you see, then jump to its fix

    1. 1The 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. 2The warning points to a line in build.gradle, settings.gradle or a script pluginYour own build script uses removed or deprecated callsFix
    3. 3The warning is the only message and the build otherwise passesYou want to move the wrapper to the next major versionFix

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 all

2Fix

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 supports

3Verify

Run the same command again and confirm the warning list is shorter or gone.

./gradlew help --warning-mode all

Confirmed by docs.gradle.org

Did this fix it?

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 fail

Confirmed by docs.gradle.org

Did this fix it?

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 --version

2Fix

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 :wrapper

3Verify

Confirm the new version and run the build.

./gradlew --version
./gradlew build

Confirmed by docs.gradle.org

Did this fix it?

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

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

Next step

Want this handled for good?

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