简体   繁体   English

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

[英]react-native : Build failed with an exception

After upgrading from 0.17 to 0.19 I'm getting this error every time I'm trying to build the application using ( react-native run-android ). 0.17升级到0.19后,每次我尝试使用( react-native run-androidbuild application时,我都会收到此错误。 I've tried downgrading back to 0.17 but it didn't help and the problem is the same. 我已经尝试降级到0.17,但它没有帮助,问题是一样的。 I've also searched the web but couldn't find anything similar to my problem . 我也在网上搜索过但找不到与我的问题类似的东西。 I guess the problem is with gradle not the react-native itself but I don't know how to solve it ?! 我想问题是gradle而不是本身的react-native但我不知道如何解决它?

Here is the error : 这是错误:

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

I appreciate any help :) 我感谢任何帮助:)

I had the same problem some days ago . 几天前我遇到了同样的问题。 It seems that you have a problem with connection , a slow one, or the site is blocked by your ISP (for any reason) or filtered by you country (like china). 您似乎遇到连接问题,速度缓慢,或者您的ISP阻止了网站(出于任何原因)或者您所在的国家/地区(如中国)进行了过滤。 Try using a Proxy and try again, it worked for me . 尝试使用代理并重试,它对我有用。

By the way the problem is not with react-native, its with gradle. 顺便说一句,问题不在于本地反应,而是与gradle有关。 And the community will include these jar files with react-native package in v0.21 which is coming this week and your problem with jcenter will be solved I hope . 社区将在v0.21中包含这些带有react-native软件包的jar文件,本周即将发布,我希望你的jcenter问题能得到解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM