我已经安装了一些需要的东西,例如:nodejs,python2,android studio,但是当运行react时,错误,可能是错误的路径,但我检查了我认为正确的路径,请帮助
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
Android Studio上的SDK位置:/home/rojib/Android/Sdk,有什么问题吗?
最佳答案
试试这个
将此行输入到 scripts
中的 package.json
文件
"android": "ANDROID_HOME='Your android SDK Location' node node_modules/react-native/local-cli/cli.js run-android",
输入此行后打开终端并运行
npm run android
希望它对你有用......
关于javascript - 错误路径sdk react native linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48264079/