android launch issues. Unsupported class file major version 57
To fix this error I went to the file directory at android/gradle/wrapper/gradle-wrapper.properties
and modified the distributionUrl
which was set to gradle-5.5
instead I used gradle-6.0
. For some reason, it does not recognize the 6.2 distribution, even though this is the version of gradle I am currently on. I figured this was supposed to correspond to the version but apparently not.
Instead of:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
Use:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip
This is because your JDK version doesnot support Gradle version of your project. Gradle 5 is not supported in jdk-13. Best Solution is to change your gradle version in gradle-wrapper.properties. You can set any gradle version later than 6,
Or
Got to (on Mac) Preferences>Build,Execution,Deployment>Gradle
(Windows) File>Settings>Build,Execution,Deployment>Gradle
Then under section Gradle You can choose Gradle and Java as given in picture below
You can also install gradle separately and use specified path. However I recommend you to use gradle-wrapper.properties file and Gradle JVM to internal JDK or Project JVM. This way you don't have to uninstall your JDK 13 and install downgraded JDK11 or JDK12
If you do not find this option in Android Studio, Downgrade your JDK or use first option.
I suffer the same issue when run gradle build
. According to search from google and github. I found the gradle
current version (5.x.x) not support jdk 13. Finally, the 6.x version support it, but it has not been released, so I have to downgrade the jdk version to 12.x.
Downgrade java to 12 https://www.jverdeyen.be/mac/downgrade-brew-cask-application/
brew cask uninstall adoptopenjdk # uninstall jdk version 13.x
brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk12