gpt4 book ai didi

android - Gradle 安装有代理问题

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:14:17 25 4
gpt4 key购买 nike

我在 Jenkins 代理后面的公司网络服务器上构建 android 项目时遇到问题。尝试过 jenkins gradle 和 gradlew。下面是开启 Debug模式后的错误信息。

17:12:31 17:12:40.482 [INFO] [com.android.build.gradle.internal.DependencyManager] Parsing /opt/android/tools/package.xml

17:12:32 17:12:42.383 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running
17:12:42 17:12:52.384 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
17:12:42 17:12:52.384 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
17:12:42 17:12:52.384 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.

17:12:46 17:12:55.512 [WARN] [com.android.build.gradle.internal.DependencyManager] Failed to connect to host: https://dl.google.com/android/repository/addons_list-3.xml
17:12:46 17:12:55.513 [WARN] [com.android.build.gradle.internal.DependencyManager] Failed to connect to host: https://dl.google.com/android/repository/addons_list-2.xml
17:12:46 17:12:55.514 [WARN] [com.android.build.gradle.internal.DependencyManager] Failed to connect to host: https://dl.google.com/android/repository/addons_list-1.xml
17:12:46 17:12:55.515 [WARN] [com.android.build.gradle.internal.DependencyManager] Failed to download any source lists!
17:12:46 17:12:55.516 [WARN] [com.android.build.gradle.internal.DependencyManager] java.net.UnknownHostException: dl.google.com
17:12:46 17:12:55.543 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
17:12:46 17:12:55.544 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.

这是 gradle.properties 的内容。

systemProp.http.proxyHost=proxy.server
systemProp.https.proxyHost=proxy.server
systemProp.http.proxyPort=8080
systemProp.https.proxyPort=8080

我尝试传递带有 jvm 标志的代理设置,并尝试了 gradle 版本 3.3 到 3.5。有什么我想念的吗?

最佳答案

对我来说 issuehttp 前缀!如果是这种情况,请删除 http/https 前缀!

我的 gradle.properties 是这样的,但失败了:

systemProp.http.proxyHost=http://squid.proxy.com
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=http://squid.proxy.com
systemProp.https.proxyPort=8080

Proper way to set proxy settings for gradle is:

systemProp.http.proxyHost=squid.proxy.com
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=squid.proxy.com
systemProp.https.proxyPort=8080

关于android - Gradle 安装有代理问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44109325/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com