我正在Windows 10系统上进行react-native
入门。我能够执行react-native init AwesomeProject
命令,现在需要执行以下命令:
>react-native run-android
但这失败并显示此错误:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory 'C:\Users\plankton\AppData\Local\Android\android-sdk' does not exist.
* 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: 2 mins 0.64 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 SDK,现在的路径是:C:\Users\plankton\AppData\Local\Android\sdk
NOT C:\Users\plankton\AppData\Local\Android-sdk
。如果我在像OS这样的Unix上的某个地方,我只会建立一个syslink。但是我正在使用Windows10。该怎么办?您如何在Windows中进行系统链接?
在Windows上,它查看ANDROID_HOME环境变量。您应该能够更新它,关闭命令提示符或powershell并重新启动它,然后重试。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句