简体   繁体   English

无法解析配置“:app:debugRuntimeClasspath”的所有任务依赖项

[英]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. 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:问题是当我运行react-native run-android命令时,出现以下错误:

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.我在 web 上找不到一些类似的问题,我不确定要显示与此问题相关的内容。

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.同样,当我创建一个新的 react-native 项目并尝试运行它时,我也遇到了同样的错误。 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.对于遇到相同错误的人,请尝试连接到错误中的链接以判断是否禁止。

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

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