I am encountering an SSLHandshakeException while trying to build and install a React Native app using Gradle on my Windows machine. The error occurs when Gradle attempts to resolve dependencies. Here are the details of the error:
What went wrong:
A problem occurred configuring root project 'app_name'.
> Could not determine the dependencies of task ':gradle-plugin:compileKotlin'.
> javax.net.ssl.SSLHandshakeException: 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 12s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'app_name'. > Could not determine the dependencies of task ':gradle-plugin:compileKotlin'. > javax.net.ssl.
SSLHandshakeException: 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 12s.
I verified that my internet connection is stable, Executed the build with the --info flag to obtain detailed logs and ran gradlew cleanBuildCache to clear the Gradle cache but nothing seems to work.