【问题标题】:Jenkins: Could not resolve com.android.tools.build:gradle:2.2.2詹金斯:无法解析 com.android.tools.build:gradle:2.2.2
【发布时间】:2017-05-04 10:52:45
【问题描述】:

我有一个要使用 Jenkins 构建的 Android 项目。 Jenkins 在虚拟机上,因此无法访问 Internet。 当我尝试构建相同的内容时,出现以下错误:

> Could not resolve com.android.tools.build:gradle:2.2.2.
     Required by:
         :LocationSensing:unspecified
      > Could not resolve com.android.tools.build:gradle:2.2.2.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom'.
               > This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (jcenter.bintray.com)

如何配置 gradle-2.2.2.pom 文件以离线工作。我已下载此文件,但不确定是否将其配置为离线工作。

【问题讨论】:

    标签: android jenkins gradle jcenter


    【解决方案1】:

    如果你在 Gradle 中使用新的插件 DSL,你必须定义一个可由构建机器访问的 pluginRepository。如果您想直接指定本地可用的 JAR 文件作为依赖项,请不要使用新插件 DSL,而是使用旧式方式将 Gradle 插件 JAR 添加到构建脚本的类路径中,然后手动应用插件。

    【讨论】:

      猜你喜欢
      • 2017-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-08
      • 2014-09-09
      • 1970-01-01
      相关资源
      最近更新 更多