android - Gradle无法下载Android软件包

标签 android docker gradle proxy android-gradle-plugin

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

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

android update sdk



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

猫/root/.android/androidtool.cfg
sdkman.force.http=true
http.proxyHost=gateway.bns 
http.proxyPort=8000

猫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清洁测试组装
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!

最佳答案

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

关于android - Gradle无法下载Android软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44929694/

相关文章:

android - 在相对布局的中心查看

android - 您的 APK 或 Android App Bundle 需要具有包名称 com.voca.abc

Android 通过我的应用程序共享链接和图像

postgresql - 如何将卷挂载添加到正在运行的 postgreSQL 容器中?

java - 构建两个build.gradle文件,第二个build.gradle的文件路径错误

java - Android - 获取用户在webview中点击的链接

django - Dockercontinuum/miniconda3容器未显示 “conda”

docker - 无法在 Docker 容器中运行命令

java - Google Play要求从受影响的应用中删除Install_referrer

gradle - 使用Gradle运行测试时如何排除jersey 1.x依赖关系