[Unsupported Java.
Your build is currently configured to use Java 19.0.2 and Gradle 7.5.
Your build is currently configured to use Java 19.0.2 and Gradle 7.5.
Possible solution:
- Open Gradle wrapper settings, change
distributionUrl
property to use compatible Gradle version and reload the project
2
Answers
Download and install Java version
19.0.2
from here.Then go to
Gradle/Wrapper/gradle-wrapper.properties
from your root project and set thedistributionUrl
property tohttps://services.gradle.org/distributions/gradle-7.5-bin.zip
.Next, sync your Gradle project in Android Studio.
Apparently Gradle 7.5 doesn’t support Java 19. That fix went into Gradle 7.6.
So open
gradle-wrapper.properties
and change the lineto
Changing 7.5 to 7.6.
Android studio will download the updated Gradle and then you can resync and shouldn’t have any errors. Worked for me at least, hope it does for you too.