1

i am new to react native running yarn android i get an error concerning gradle...

i will be greatfull if anyone can help me..

`FAILURE: Build failed with an exception.

  • Where: Settings file '/Users/username/Desktop/personal projects/appname/android/settings.gradle'

  • What went wrong: Could not compile settings file '/Users/username/Desktop/personal projects/appname/android/settings.gradle'.

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

java.lang.IllegalArgumentException: Unsupported class file major version 61`

3
  • github.com/gradle/gradle/issues/13629 According to this issue, Java 16 is not supported yet, can you try to downgrade your java/jdk version? Commented Nov 9, 2021 at 6:33
  • i have downgraded it i now get this error \ FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/gift/Desktop/personal projects/geezyApp/android/local.properties'. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Commented Nov 9, 2021 at 6:54
  • 1
    You should set ANDROID_HOME and JAVA_HOME env variables. reactnative.dev/docs/environment-setup confluence.atlassian.com/doc/… Commented Nov 9, 2021 at 7:09

1 Answer 1

2

I think the problem is being caused because of one of the following reasons;

  1. Misconfigured Java Run-time
  2. Misconfigured Android SDK

I'd advise you to follow the guide at ReactNative.dev

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.