react-native:构建因异常而失败

ham*_*had 6 android build gradle react-native

从升级后0.170.19我每次收到此错误我想buildapplication使用(react-native run-android).我已经尝试降级到0.17,但它没有帮助,问题是一样的.我也在网上搜索过但找不到与我的问题类似的东西.我想问题gradle不在于react-native自身,而是我不知道如何解决它?

这是错误:

Starting JS server...
Starting the packager in a new window is not supported on Windows yet.
Please start it manually using 'react-native start'.
We believe the best Windows support will come from a community of people
using React Native on Windows on a daily basis.
Would you be up for sending a pull request?
Building and installing the app on the device (cd android && gradlew.bat install
Debug)...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not resolve com.facebook.react:react-native:0.19.+.
     Required by:
         sess:app:unspecified
      > Could not resolve com.facebook.react:react-native:0.19.+.
         > Failed to list versions for com.facebook.react:react-native.
            > Unable to load Maven meta-data from https://jcenter.bintray.com/co
m/facebook/react/react-native/maven-metadata.xml.
               > Could not GET 'https://jcenter.bintray.com/com/facebook/react/r
eact-native/maven-metadata.xml'.
                  > Connection to https://jcenter.bintray.com refused

* 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: 48.737 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
Run Code Online (Sandbox Code Playgroud)

我感谢任何帮助:)

Moh*_*shi 7

几天前我遇到了同样的问题.您似乎遇到连接问题,速度缓慢,或者您的ISP阻止了网站(出于任何原因)或者您所在的国家/地区(如中国)进行了过滤.尝试使用代理并重试,它对我有用.

顺便说一句,问题不在于本地反应,而是与gradle有关.社区将在v0.21中包含这些带有react-native软件包的jar文件,本周即将发布,我希望你的jcenter问题能得到解决.