gpt4 book ai didi

java - Flutter Gradle 构建失败,出现异常

转载 作者:行者123 更新时间:2023-11-29 02:25:56 24 4
gpt4 key购买 nike

在我们代理背后的公司中,我无法启动 flutter 项目。我没有运行 gradle。

我将此配置设置到 gradle.properties 中:

systemProp.http.proxyHost=http://my.company.com
systemProp.http.proxyPort=8080
systemProp.http.nonProxyHosts=127.0.0.1|localhost
systemProp.https.proxyHost=http://my.company.com
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=127.0.0.1|localhost

SSL 加密流量将被解密。我们的代理服务器上有自签名证书。我找不到任何方法告诉 gradle 我的 certs.pem 文件的路径。

堆栈跟踪

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
Exit code 1 from: C:\Users\i01002704\Documents\Projects\Android\time_tracker\android\gradlew.bat app:properties:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.1.4.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.1.4.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom'.
> http://my.company.com
> Could not resolve com.android.tools.build:gradle:3.1.4.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom'.
> http://my.company.com
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61.
Required by:
project :
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61.
> Could not get resource 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.61/kotlin-gradle-plugin-1.2.61.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.61/kotlin-gradle-plugin-1.2.61.pom'.
> http://my.company.com
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61.
> Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.61/kotlin-gradle-plugin-1.2.61.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.61/kotlin-gradle-plugin-1.2.61.pom'.
> http://my.company.com

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

Finished with error: Please review your Gradle project setup in the android/ folder.

最佳答案

编辑 gradle/wrapper/gradle-wrapper.properties 并更新到 Gradle 4.44.5:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip

还要确保 buildscript 添加了存储库 google()

documentation不提供设置证书的选项。

关于java - Flutter Gradle 构建失败,出现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52202527/

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