Whimsy Cat
Whimsy Cat

Reputation: 410

Error : Could not determine the dependencies of task ':app:compileDebugJavaWithJavac' while running React Native Project

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.

Upvotes: 3

Views: 15799

Answers (2)

Mangala Karunarathne
Mangala Karunarathne

Reputation: 319

enter image description here

Add your Sdk path as shown in image..

Upvotes: 0

user19337332
user19337332

Reputation:

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.

Upvotes: 8

Related Questions