我有一个带有Android SDK的docker容器。我正在尝试使用gradlew构建一个Android Java应用程序。问题是,如果我需要从互联网上下载,我需要使用代理。我为此配置了我的android和gradle以使用代理设置。
我可以使用命令
从命令行下载软件包android update 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!
答案 0 :(得分:0)
如果你使用的是比2.2.3更新的插件版本,我认为这可以链接到: Unable to update sdk dependencies with latest android gradle plugin