Everyone! 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. Thanks in advance.
CodePudding user response:
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.