javascript - 错误路径sdk react native linux

标签 javascript android reactjs react-native

我已经安装了一些需要的东西,例如: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/

相关文章:

javascript - 使用 Capybara 检测 javascript 事件处理程序

android - setOnItemClickListener 在 ListView Activity 中给出编译错误

reactjs - Apollo 错误处理与 React Native

javascript - 如何提供受 HTTP 身份验证保护的文件的下载

javascript - 需要函数对 htm 页面中生成的 <li> 进行排序

javascript - 如果我将一个 JavaScript 事件绑定(bind)到一个元素,然后删除该元素,该事件会发生什么?

android - 如何在android中的交换机上显示进程状态?

java - LIBGDX 水平和垂直视差背景

javascript - React Router - 在嵌套组件内安装组件

javascript - 如何在Draft.js中插入/上传图像(更新实体和 block )?