我正在尝试在需要基本身份验证和自签名 HTTPS 连接的公司代理后面运行一个空白的 Flutter 项目。
我在 ~/.gradle/gradle.properties
和 ~/.profile
中添加了必要的配置.我还在$JAVA_HOME/jre/lib/security/cacerts
中导入了我的根证书,并告诉 Gradle 使用它。我什至尝试了这个解决方案并在$JAVA_HOME/jre/lib/net.properties
中设置了java.net.useSystemProxies=true
.
但是,它仍然没有构建,并且要求进行身份验证。
flutter run
Launching lib/main.dart on Nexus 5 in debug mode...
Initializing gradle... 0.8s
Resolving dependencies...
* Error running Gradle:
Exit code 1 from: ~/GitLab/n.gendron/techno_store/android/gradlew app:properties:
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
IOException: https://dl.google.com/android/repository/addons_list-3.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
IOException: https://dl.google.com/android/repository/addons_list-2.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
IOException: https://dl.google.com/android/repository/addons_list-1.xml
java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authentication Required"
Failed to download any source lists!
本指南在整个过程中帮助了我很多,本指南帮助我导入了 CA,但现在我卡住了。
知道吗?
在gradle/gradle.properties中写:
# Project-wide Gradle settings.
...
systemProp.http.proxyHost=proxy.company.com
systemProp.http.proxyPort=443
systemProp.http.proxyUser=username
systemProp.http.proxyPassword=password
systemProp.http.auth.ntlm.domain=domain
systemProp.https.proxyHost=proxy.company.com
systemProp.https.proxyPort=443
systemProp.https.proxyUser=username
systemProp.https.proxyPassword=password
systemProp.https.auth.ntlm.domain=domain
...