简体   繁体   中英

Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'

I am developing a mobile app with using react-native on WebStorm and trying to test it via an Android emulator(Pixel API 28) which I created via using AVD Manager of Android Studio. The problem is when I run the react-native run-android command, I get the following error:

Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration             
':app:debugRuntimeClasspath'.
   > Could not resolve com.facebook.react:react-native:+.
     Required by:
         project :app
      > Failed to list versions for com.facebook.react:react-native.
         > Unable to load Maven meta-data from         
https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
            > Could not HEAD 
'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
               > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/35.158.228.205, jcenter.bintray.com/3.120.47.203] failed: Read timed out

I tried to clean up the cache with using the command below but it did not worked:

npm cache clean --force

I could not find some similar problems on the web and I am not sure what to show related with this problem.

When I try to run one of my previous project which was perfectly running, after getting this error and I saw that it also throws the same error. Similarly, when I create a new react-native project and try to run it, then I also got the same error. How can I solve this?


I am still loking for a solution. Anyone knows how to solve it?

I finally figured out the problem. I was connecting to internet via my school's network and it was restricting some downloads. So, that is why I got this error. For the ones who encountered with the same error, try to connect to the link in the error to if it is forbidden or not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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