react-native run-android命令无法解析配置':classpath'的所有工件

时间:2019-03-25 15:27:49

标签: android react-native

当尝试运行react-native run-android gradle无法解析所有配置时:classpath。

react-native run-android
info JS server already running.
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'AwesomeProject'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.3.1.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.3.1.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'.
               > Connect to dl.google.com:443 [dl.google.com/172.217.21.238] failed: Connection timed out: connect
      > Could not resolve com.android.tools.build:gradle:3.3.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.1/gradle-3.3.1.pom'.
               > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/18.195.111.75, jcenter.bintray.com/35.156.75.35] failed: Connection timed out: connect

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 4s
error 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/getting-started.html
error Command failed: gradlew.bat app:installDebug

我已经尝试了所有可能找到的解决方案,例如将google()添加到allProjects存储库等。

0 个答案:

没有答案