Android app fails to build with SSLHandshakeException

Resolving javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed

Recently, I tried to build an Android project and it failed with the above error. It was a super nasty error to fix and I spent quite some time on it.

Actually, there was only one fix that worked for me. Install a new Java environment or JDK and set it as a default Java instance to be used. Re-start Android Studio with Invalidate Cache & Restart and then in Settings -> Build, Execution and Deployment change the Java version to be used and you should be good to go.

Leave a comment