3

I have got an error while trying to run my React Native project.

react-native run-android

Error looks like

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 'E:\IT tasks\android\ninja-react-native\android\local.properties'.

Please help me.

2 Answers 2

8

Add SDK(sdk.dir) location path in local.properties file:

For windows users:

sdk.dir = C:\\Users"MyUserName"\\AppData\\Local\\Android\\Sdk

For Mac users:

sdk.dir = /Users/USERNAME/Library/Android/sdk

For Linux users:

sdk.dir = /home/USERNAME/Android/Sdk

Replace Username with your's users Name. And check that sdk forlder name is Sdk or sdk, replace with it.

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

Comments

0

enter image description here

Add your Sdk path as shown in image..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.