【问题标题】:Gradle not able to download android packagesGradle无法下载android包
【发布时间】:2017-07-05 14:55:40
【问题描述】:

我有一个带有 Android SDK 的 docker 容器。我正在尝试使用 gradlew 构建一个 Android Java 应用程序。问题是如果我需要从互联网下载,我需要使用代理。为此,我已将我的 android 和 gradle 配置为使用代理设置。

我可以使用命令从命令行下载软件包

安卓更新sdk

但是当我运行 gradlew 时,它能够从 jcentre 下载依赖项,但尝试下载一些我认为的 Android 包失败。我在下面粘贴了错误消息。

cat /root/.android/androidtool.cfg

sdkman.force.http=true
http.proxyHost=gateway.bns 
http.proxyPort=8000

cat gradle.properties

systemProp.http.proxyHost=xyz.abc
systemProp.http.proxyPort=8000
systemProp.http.nonProxyHosts=*.abc
systemProp.https.proxyHost=xyz.abc
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=*.abc

./gradlew clean test assemble

DK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

Error:

    File /root/.android/repositories.cfg could not be loaded.
    java.net.ConnectException: Connection timed out (Connection timed out)
    IOException: https://dl.google.com/android/repository/addons_list-3.xml
    java.net.ConnectException: Connection timed out (Connection timed out)
    IOException: https://dl.google.com/android/repository/addons_list-2.xml
    java.net.ConnectException: Connection timed out (Connection timed out)
    IOException: https://dl.google.com/android/repository/addons_list-1.xml
    java.net.ConnectException: Connection timed out (Connection timed out)
    Failed to download any source lists!

【问题讨论】:

    标签: android docker gradle proxy android-gradle-plugin


    【解决方案1】:

    如果您曾经使用过比 2.2.3 更新的插件版本,我认为这可以链接到: Unable to update sdk dependencies with latest android gradle plugin

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-06
      • 2019-09-15
      • 2021-04-14
      • 2021-07-12
      • 2018-04-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多