2

I am trying to start the default flutter app on a company MAC laptop which is connected behind a proxy.
Upon clicking debug on my Android Studio (Connected to an Android Emulator API 28 (also tried API 30)) I am
gettting the following error:

Launching lib/main.dart on AOSP on IA Emulator in debug mode... Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not resolve io.flutter:flutter_embedding_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718. Required by: project :app > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718. > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/flutter_embedding_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718.pom'. > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/flutter_embedding_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718.pom'. > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Could not resolve io.flutter:x86_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718. Required by: project :app > Could not resolve io.flutter:x86_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718. > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/x86_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718.pom'. > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/x86_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718.pom'. > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Could not resolve io.flutter:x86_64_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718. Required by: project :app > Could not resolve io.flutter:x86_64_debug:1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718. > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/x86_64_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718.pom'. > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718/x86_64_debug-1.0.0-0fdb562ac8068ce3dda6b69aca3f355f4d1d2718.pom'. > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I was getting proxy errors prior to this which I've fixed by adding a gradle.properties file under the .gradle folder with following data:

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

I do have a truststore file which I use for other projects where it is needed such as Spring, JBoss, Tomcat related projects.
Unsure if this is the truststore file that is required
The file type is Java keyStore.

Inside the project, there is a gradlew file. Within there I added the following to point to that truststore file.

-Djavax.net.ssl.trustStore=truststore

This makes no difference and end up with same error. The path to truststore file is correct. Cos for testing, I added the following.
And it does throw a different error saying file not found as expected.

-Djavax.net.ssl.trustStore=truststore12345

This data seems to indicate some cert issues now. I am only using this locally.
Alternatively, is there a way I could by pass this security check?

Please advice. Thank you.

karvai
  • 2,417
  • 16
  • 31
  • Looks like the proxy intercepts HTTPS connections. Have you tried to configure the trust store on gradle level? https://stackoverflow.com/q/43483514/150978 – Robert Jun 26 '21 at 14:53
  • As a last resort you may consider copying the proxy certificates from the truststore you have into the Java system truststore. But that depends on your OS and the used Java version. – Robert Jun 26 '21 at 14:55

0 Answers0