android - react-native run-android 命令无法解析配置“:classpath”的所有工件
问题描述
尝试运行 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 存储库等。
解决方案
推荐阅读
- assembly - 简单程序中的段错误:在程序集中打开、关闭文件,x86_64
- c# - RS232 串行通信只发送字符串的第一个字符
- python - 使用循环的 Python 函数
- components - Sails.js- 如何将顶部导航移动到组件?
- excel - VBA根据两个标准选择行;一个“价值”和另一个“InStr”,也许吧?
- python - 从 Spark 结构流中反序列化 Avro
- php - Apache 为不存在的页面返回 200 状态
- python - 处理数据框列中的大量不同值
- php - 如果 Woocommerce 订单项具有特定的自定义元数据,则向电子邮件添加文本
- javascript - 将面积图上的刻度线与字符串 X 值对齐