首页 > 解决方案 > 使用 Android Emulator 启动项目时出现认证错误

问题描述

我正在尝试在连接在代理后面的公司 MAC 笔记本电脑上启动默认的颤振应用程序。
在我的 Android Studio(连接到 Android Emulator API 28(也尝试过 API 30))上单击调试后,我
收到以下错误:

以调试模式在 IA 模拟器上的 AOSP 上启动 lib/main.dart... 运行 Gradle 任务“assembleDebug”...

FAILURE:构建失败并出现异常。

  • 出了什么问题:任务':app:checkDebugAarMetadata'的执行失败。

无法解析配置“:app:debugRuntimeClasspath”的所有文件。无法解析 io.flutter:flutter_embedding_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718。要求:项目:app > 无法解析 io.flutter:flutter_embedding_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718。> 无法获取资源 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/flutter_embedding_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f355555555 > 无法获取'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/flutter_embedding_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f3555555555 > PKIX 路径构建失败:sun.security.provider。certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径无法解析 io.flutter:x86_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718。要求:项目:app > 无法解析 io.flutter:x86_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718。> 无法获取资源'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/x86_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d27'1。> 无法获取'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/x86_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d27'1。> PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到请求目标的有效证书路径无法解析 io.flutter:x86_64_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718。要求:项目:app > 无法解析 io.flutter:x86_64_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718。> 无法获取资源'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/x86_64_debug-1.0.0-0fdb562ac8068ce3dda6b169aca3f3555555555 > 无法获取 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/x86_64_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f355555555.f > PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:

在此之前我遇到了代理错误,我通过在 .gradle 文件夹下添加一个 gradle.properties 文件来修复它,其中包含以下数据:

systemProp.http.proxyHost=proxy.company.com
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=myId
systemProp.http.proxyPassword=myPass
systemProp.http.nonProxyHosts=localhost,127.0.0.1,0.0.0.0,.company.com

systemProp.https.proxyHost=proxy.company.com
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=myId
systemProp.https.proxyPassword=myPass
systemProp.http.nonProxyHosts=localhost,127.0.0.1,0.0.0.0,.company.com

我确实有一个信任库文件,可用于其他需要它的项目,例如 Spring、JBoss、Tomcat 相关项目。
不确定这是否是所需的信任库文件
文件类型是 Java keyStore。

在项目内部,有一个 gradlew 文件。在其中我添加了以下内容以指向该信任库文件。

-Djavax.net.ssl.trustStore=truststore

这没有任何区别,最终会出现相同的错误。信任库文件的路径正确。因为为了测试,我添加了以下内容。
它确实会抛出一个不同的错误,指出未按预期找到文件。

-Djavax.net.ssl.trustStore=truststore12345

该数据似乎表明现在存在一些证书问题。我只在本地使用它。
或者,有没有办法通过这个安全检查?

请指教。谢谢你。

标签: javaandroidfluttergradle

解决方案


推荐阅读