我正在尝试在窗口10中运行react-native run-android命令。我在环境变量的系统变量中使用ANDROID_HOME设置了SDK文件夹的路径
ANDROID_HOME | C:\Users\owner\AppData\Local\Android\Sdk
我还在local.properties文件中设置了sdk.dir
sdk.dir=C\:\\Users\\owner\\AppData\\Local\\Android\\Sdk
但是,当我运行命令行
时react-native run-android
在我的项目文件夹C:\ Users \ owner \ Documents \ React_Native \ MyApplication>它给了我一个例外如下。
C:\Users\owner\Documents\React_Native\MyApplication>react-native run-android
Scanning folders for symlinks in C:\Users\owner\Documents\React_Native\MyApplication\node_modules (34ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring 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: 5.305 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