2017-04-11 49 views
0

我剛剛嘗試按照文檔here運行react-native-git-upgrade。運行升級後,我嘗試使用react-native run-android開始我的項目,但出現以下錯誤(請參閱下文)。react-native-git-upgrade不起作用

我也試圖按照從該文檔升級的「替代」方式,但最終以下面顯示的相同錯誤結束。

我該如何繼續升級才能正常工作?

FAILURE: Build failed with an exception. 

* What went wrong: 
A problem occurred configuring project ':app'. 
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'. 
    > Could not resolve com.facebook.fresco:fresco:1.0.1. 
    Required by: 
     OrderEntry:app:unspecified > com.facebook.react:react-native:0.43.3 
     > Could not resolve com.facebook.fresco:fresco:1.0.1. 
     > Could not get resource 'https://jcenter.bintray.com/com/facebook/fresco/fresco/1.0.1/fresco-1.0.1.pom'. 
      > Could not GET 'https://jcenter.bintray.com/com/facebook/fresco/fresco/1.0.1/fresco-1.0.1.pom'. 
       > jcenter.bintray.com 
    > Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.0.1. 
    Required by: 
     OrderEntry:app:unspecified > com.facebook.react:react-native:0.43.3 
     > Could not resolve com.facebook.fresco:imagepipeline-okhttp3:1.0.1. 
     > Could not get resource 'https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-okhttp3/1.0.1/imagepipeline-okhttp3-1.0.1.pom'. 
      > Could not GET 'https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-okhttp3/1.0.1/imagepipeline-okhttp3-1.0.1.pom'. 
       > jcenter.bintray.com 

回答

0

我終於能夠解決這個問題。原來,由於代理問題,gradle無法訪問Google存儲庫,這是一個問題。要解決這個問題,我添加了一個gradle.properties文件到我的C:\Users\my_user_id>\.gradle文件夾下面的值:

systemProp.http.proxyHost=your_proxy.com 
systemProp.http.proxyPort=80 

systemProp.https.proxyHost=your_proxy.com 
systemProp.https.proxyPort=80 

一旦我添加了文件,我居然遇到了更多的問題,你可以讀到here,但我終於得到了事情在運行。

我不確定爲什麼項目在以前的react-native版本上運行正常,而不需要gradle.properties文件。無論如何,希望這有助於任何人有同樣的問題。