After upgrading to Android Studio Ladybug, I get the following error message:
Your build is currently configured to use incompatible Java 21.0.3 and
Gradle 8.0. Cannot sync the project.
We recommend upgrading to Gradle version 8.9.
The minimum compatible Gradle version is 8.5.
The maximum compatible Gradle JVM version is 19.
Possible solutions:
- Upgrade to Gradle 8.9 and re-sync
- Upgrade to Gradle 8.5 and re-sync
I don't want to upgrade Gradle now. What is the simplest solution to build my project?
If you don't want to upgrade Gradle yet, the simplest and fatest solution is to downgrade the Java SDK by downloading an older version. Here is how to do it:
N.B. If after downgrading to Java 17 you still cannot build and you see an error like
module jdk.compiler does not export com.sun.tools.javac.main to unnamed module
you should restart your machine.