gradle Flutter:Android build failed - Could not resolve io.flutter:flutter_embedded_debug:1.0.0-d44b5a94c976fbb65815374f61ab5392a220b084

yyyllmsg  于 2023-06-23  发布在  Flutter
关注(0)|答案(1)|浏览(240)

我正在尝试为Android构建Flutter应用程序。我遵循flutter网站的官方设置指南,创建了默认项目,然后在模拟器上运行。
这是我得到的错误:

> Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-d44b5a94c976fbb65815374f61ab5392a220b084/x86_debug-1.0.0-d44b5a94c976fbb65815374f61ab5392a220b084.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-d44b5a94c976fbb65815374f61ab5392a220b084/x86_debug-1.0.0-d44b5a94c976fbb65815374f61ab5392a220b084.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* 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 993ms
[!] Gradle threw an error while downloading artifacts from the network.

如果我把URL放在浏览器中,我可以下载.pom文件,我真的不明白为什么我得到这个错误。
这是我的flutter doctor -v的结果:

[√] Flutter (Channel stable, 3.10.0, on Microsoft Windows [Versione 10.0.22621.1848], locale it-IT)
• Flutter version 3.10.0 on channel stable at C:\SDK\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 84a1e904f4 (6 weeks ago), 2023-05-09 07:41:44 -0700
• Engine revision d44b5a94c9
• Dart version 3.0.0
• DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\gazzi.n\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Professional 2022 17.6.3)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Professional
• Visual Studio Professional 2022 version 17.6.33801.468
• Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
   https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
   https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] VS Code (version 1.79.2)
• VS Code at C:\Users\gazzi.n\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.66.0

[√] Connected device (4 available)
• sdk gphone x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
• Windows (desktop)          • windows       • windows-x64    • Microsoft Windows [Versione 10.0.22621.1848]
• Chrome (web)               • chrome        • web-javascript • Google Chrome 114.0.5735.134
• Edge (web)                 • edge          • web-javascript • Microsoft Edge 114.0.1823.51

[√] Network resources
• All expected network resources are available.

• No issues found!

我使用的是Windows 11,在我的网络设置中,我启用了TLS 1.0,1.1,1.2,1.3。
我厌倦了几乎所有我在网上找到的东西,如更新到flutter 3. 10. 5,删除和重新安装flutter,创建很多新项目,更改gradle文件配置...我在一家有防火墙的公司,但似乎没有什么东西可以阻止我对网络的请求。
有人能帮我解决这个错误吗?如果需要其他信息或文件,请随时询问。
谢谢你

uajslkp6

uajslkp61#

我找到了一个变通办法。
在公司防火墙级别,我添加了一条规则,storage.googleapis.com当使用HTTP 2协议时,在SSL声明规则中排除“www.example.com”域。
否则,您可以遵循here提供的解决方案
这使我能够在Flutter中成功构建一个Android应用程序。

相关问题