Home > Net >  Flutter app PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: u
Flutter app PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: u

Time:10-29

My flutter app, which was able to build for many months, apparently can't build anymore, and I didn't make any build related changes.

How I build my app:

flutter build apk --split-per-abi prod -t lib/main.dart  --no-sound-null-safety

Where do i build my app:

  1. Inside Android Emulator terminal
  2. In macos terminal

Error log

[01:14:40]: ▸ FAILURE: Build failed with an exception.
[01:14:40]: ▸ * What went wrong:
[01:14:40]: ▸ Execution failed for task ':amplify_api_android:mergeReleaseResources'.
[01:14:40]: ▸ > Could not resolve all files for configuration ':amplify_api_android:releaseRuntimeClasspath'.
[01:14:40]: ▸ > Could not resolve io.flutter:flutter_embedding_release:1.0.0-3ad69d7be3a7231aab5525db322fc699f098315f.
[01:14:40]: ▸ Required by:
[01:14:40]: ▸ project :amplify_api_android
[01:14:40]: ▸ project :amplify_api_android > project :amplify_core
[01:14:40]: ▸ > Could not resolve io.flutter:flutter_embedding_release:1.0.0-3ad69d7be3a7231aab5525db322fc699f098315f.
[01:14:40]: ▸ > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-3ad69d7be3a7231aab5525db322fc699f098315f/flutter_embedding_release-1.0.0-3ad69d7be3a7231aab5525db322fc699f098315f.pom'.
[01:14:40]: ▸ > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_release/1.0.0-3ad69d7be3a7231aab5525db322fc699f098315f/flutter_embedding_release-1.0.0-3ad69d7be3a7231aab5525db322fc699f098315f.pom'.
[01:14:40]: ▸ > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[01:14:40]: ▸ * Try:
[01:14:40]: ▸ 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.
[01:14:40]: ▸ * Get more help at https://help.gradle.org
[01:14:40]: ▸ BUILD FAILED in 32s

It keeps on throwing > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

But this file, i'm able to download when I run thru the browser.

What I've done so far

  1. Invalidated android studio cache
  2. Delete flutter cache
  3. flutter clean && flutter pub get
  4. flutter channel stable && flutter clean && flutter pub get

CodePudding user response:

I solved it by running below command, but I don't understand why. Just sharing in case someone also encountered the same issue.

cd android && ./gradlew clean && ./gradlew

CodePudding user response:

Try running flutter clean and then flutter pub get, then retrying the build.

  • Related