0

I have installed some needed like: nodejs, python2, android studio, but when running react, error, possibly wrong path, but I check for the path I think is correct, please help

JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug...
Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
java.lang.RuntimeException: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
    at com.android.build.gradle.internal.SdkHandler.getAndCheckSdkFolder(SdkHandler.java:102)
FAILURE: Build failed with an exception.

* Where:
Build file '/home/rojib/Documents/react/lat3/React-Native-Sample/android/app/build.gradle' line: 104

* What went wrong:
A problem occurred evaluating project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 27.013 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

SDK location on android studio : /home/rojib/Android/Sdk, Is there something wrong ?

1 Answer 1

1

Try this

enter this line to your package.json file in scripts

"android": "ANDROID_HOME='Your android SDK Location' node node_modules/react-native/local-cli/cli.js run-android",

and after enter this line open terminal and run this

npm run android

hope it'll work for you...

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

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.