【问题标题】:Why android app dont build in Intellij IDEA?为什么 android 应用程序不在 Intellij IDEA 中构建?
【发布时间】:2018-03-03 13:16:21
【问题描述】:

我在 intellij idea 编辑器中创建了我的第一个 android 应用,但是在构建项目时出现此错误。

错误:Gradle:配置根项目“TakZarf2”时出现问题。

无法解析配置“:classpath”的所有依赖项。 无法解析 com.android.tools.build:gradle:2.2.2。 要求: :TakZarf2:未指定 无法解析 com.android.tools.build:gradle:2.2.2。 无法获取资源“https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom”。 无法获取“https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom”。 连接到 jcenter.bintray.com:443 [jcenter.bintray.com/75.126.118.188] 失败:连接超时:连接

我的互联网连接在右侧。

如何解决这个问题?

【问题讨论】:

  • 第一行解释Could not resolve all dependencies for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:2.2.2.你项目中的配置不正确。它找不到库。
  • 如何更改项目配置?
  • 关注official tutorial 或使用Android Studio 为您省去麻烦。

标签: android intellij-idea gradle


【解决方案1】:

可能是防火墙问题。请检查 URL - https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.2/ 是否可以从浏览器窗口访问。

如果上述 URL 在浏览器上有效,请检查您是否在 IntelliJ 中配置了任何 HTTP 代理。这可以从 IntelliJ=>settings=>appearance and behavior=>system settings=>http 代理访问。

【讨论】:

  • 我在上行链接上看到了数字文件,但我没有任何代理
  • 您的浏览器中是否有任何代理设置?这个问题显然与连通性有关。您可以尝试使用备用网络进行测试(例如手机上的系绳)。
猜你喜欢
  • 1970-01-01
  • 2021-01-21
  • 1970-01-01
  • 2011-07-13
  • 1970-01-01
  • 2016-08-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多