0
votes

got this error when running this command react-native run-android

I even tried so many things to deal with this like degrade your Java SDK version from 13 to 11, but nothing solved the issue.

here is the information about the error.

  • Where: Build file 'G:\react\react-native\albums\android\app\build.gradle'

  • What went wrong: Could not compile build file 'G:\react\react-native\albums\android\app\build.gradle'.

    startup failed: General error during semantic analysis: Unsupported class file major version 57

Thank you in advance.

1
please run this cmd java -version and share - Zeeshan Ansari
java 11.0.4 2019-07-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode) - Kiran Tirumalasetty

1 Answers

0
votes

It is an issue with the jdk version. Kindly share your gradle You can try to check your classpath in the gradle build file and update the latest version(3.5.0). The latest jdk versions(11,12 and 13) works fine with the latest android plugin(3.5.0). 3.5.1 is already out but has issues too. I would prefer 3.5.0 for now.

classpath 'com.android.tools.build:gradle:3.5.0'