【发布时间】:2018-07-20 16:12:48
【问题描述】:
我正在尝试使用hear 阐明的步骤运行一个 hello world 应用程序。我很确定我已经完成了所有步骤。但是当我尝试react-native run-android 时,出现以下错误。
react-native run-android ouput
C:\Users\Mike-laptop\AwesomeProject>react-native run-android
Scanning folders for symlinks in C:\Users\Mike-laptop\AwesomeProject\node_modules (43ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\Mike-laptop\AppData\Local\Android\Sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
Failed to download any source lists!
java.io.FileNotFoundException: https://dl.google.com/android/repository/repository2-1.xml
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to find Build Tools revision 26.0.3
* 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: 4.602 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/getting-started.html
请注意,我在代理后面运行一切......这很可能是因为 react-native 没有使用我设置的代理。我试图以不同的方式配置东西方法。
- 互联网选项
- 纱线配置设置代理http://host:port
- yarn config set h t t p s-proxy h t t p://host:port
- npm config 设置代理 h t t p://host:port
- npm config set h t t p s-proxy h t t p://host:port
-
设置环境变量
设置 h t t p s_proxy=h t t p s://127.0.0.1:8123 设置 h t t p _proxy=h t t p://127.0.0.1:8123 设置代理=h t t p://127.0.0.1:8123
仍然没有运气:(
非常感谢任何cmets。
【问题讨论】:
标签: react-native npm yarnpkg