Reputation: 747
Bug when first trying to run a brand new React Native application.
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 63
I encountered this error when I first installed the latest version of Java
java 19.0.1
and creating a React Native application that auto generated with
react-native dependency v0.70.6
Upvotes: 11
Views: 28809
Reputation: 41
In my case, the problem was related to the fact that I had incompatible versions of Java and Gradle running together. Look at this compatibility matrix to ensure that your installed Java version matches the Gradle one.
Upvotes: 4
Reputation: 747
SOLUTION:
This is a dependency issue and we need the latest version of Gradle to support Java 19.
In your React Native application folder, nav to android/gradle/wrapper/gradle-wrapper.properties
Find the distributionUrl
variable and change the end path to gradle-7.6-all.zip
Upvotes: 56