Gradle cannot start the Android application plugin
Could not create plugin of type 'AppPlugin'Short answer
The Android Gradle plugin refuses to load when the Gradle or the JDK running the build is older than the plugin supports. Read the 'Caused by' lines under the error, then compare the plugin version in your build file with the minimum Gradle and JDK versions in the Android documentation, and raise whichever is too old.
Fix it fast
1Find out which cause you have
Read the three versions that must fit together. First the Gradle version the wrapper downloads, then the plugin version in the build file, then the Java that runs Gradle.
./gradlew --version grep -rn "com.android.application" --include=build.gradle --include=build.gradle.kts --include=libs.versions.toml . java -version2Match what you see, then jump to its fix
- 1
The error appears right after you raised the plugin version, or opened a project that was upgraded on another machineGradle is older than the plugin's minimum versionFix - 2
The versions in the first step match the table, but 'java -version' shows a release older than the plugin needs, for example Java 8 or 11 with a plugin from the 8.x or 9.x seriesGradle runs on a JDK that is older than the plugin requiresFix
- 1
What does the error look like?
Could not create plugin of type 'AppPlugin'A problem occurred configuring project ':app'
Cause 1 of 2
Gradle is older than the plugin's minimum version
1Check
The Android documentation lists the minimum Gradle for each plugin version: 7.0 needs 7.0, 8.0 needs 8.0, 8.13 needs 8.13, 9.0 needs 9.1.0 and 9.5 needs 9.6.0. Compare it with the distributionUrl in the wrapper file.
grep distributionUrl gradle/wrapper/gradle-wrapper.properties2Fix
Raise Gradle with the wrapper task. The Gradle manual says to run it twice, because the first run updates only gradle-wrapper.properties. If the wrapper cannot start at all, edit distributionUrl by hand, as the Android documentation shows.
./gradlew :wrapper --gradle-version 8.13
./gradlew :wrapper --gradle-version 8.13
# gradle/wrapper/gradle-wrapper.properties (manual edit)
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip3Verify
The wrapper now reports a version that meets the plugin's minimum, and the project configures.
./gradlew --version
./gradlew :app:tasksConfirmed by developer.android.com
Cause 2 of 2
Gradle runs on a JDK that is older than the plugin requires
1Check
AGP 7.0 requires JDK 11 to run Gradle. AGP 8.0 requires JDK 17, and AGP 9.5 lists JDK 17 as its minimum too. Check which JDK Gradle really uses: JAVA_HOME, or the Gradle JDK setting in Android Studio.
echo $JAVA_HOME
java -version2Fix
Point Gradle at a JDK of the required release. Outside Android Studio, set the JAVA_HOME environment variable or pass -Dorg.gradle.java.home with the install directory of the JDK, as the Android documentation describes.
# Linux or macOS shell (example path)
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
./gradlew -Dorg.gradle.java.home=$JAVA_HOME :app:tasks3Verify
Run the build again from a fresh shell, with the JDK set as above.
./gradlew :app:assembleDebugConfirmed by developer.android.com
How do I stop it coming back?
- Change the plugin version and the Gradle wrapper version in the same commit, using the table in the Android documentation.
- Pin the plugin version in one place (the version catalog or the root build file) so modules cannot disagree.
- Set the Gradle JDK in Android Studio and JAVA_HOME on CI to the same release.
- Commit gradle/wrapper/gradle-wrapper.properties, so every machine and CI runner downloads the same Gradle.
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
Flutter Android build fails: Java is too new for this Gradle version
Unsupported class file major version 61
Gradle only runs on Java versions it knows.
3 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