Failing to build react native project with expo -

Hi,

I’m having the following error when trying to build an android app locally, using the command npx expo run:android.

Note - I have tried uninstalling and reinstalling the react-native-async-storage_async-storage package.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-async-storage_async-storage'.
> Could not determine the dependencies of null.
   > Could not resolve all task dependencies for configuration ':react-native-async-storage_async-storage:classpath'.
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20.
        Required by:
            project :react-native-async-storage_async-storage
         > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20.
            > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.9.20/kotlin-gradle-plugin-1.9.20.pom'.
               > Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.9.20/kotlin-gradle-plugin-1.9.20.pom'.
                  > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5.1/userguide/build_environment.html#gradle_system_properties
                     > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.google.devtools.ksp:symbol-processing-gradle-plugin:1.9.20-1.0.14.
        Required by:
            project :react-native-async-storage_async-storage
         > Could not resolve com.google.devtools.ksp:symbol-processing-gradle-plugin:1.9.20-1.0.14.
            > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/devtools/ksp/symbol-processing-gradle-plugin/1.9.20-1.0.14/symbol-processing-gradle-plugin-1.9.20-1.0.14.pom'.
               > Could not GET 'https://repo.maven.apache.org/maven2/com/google/devtools/ksp/symbol-processing-gradle-plugin/1.9.20-1.0.14/symbol-processing-gradle-plugin-1.9.20-1.0.14.pom'.
                  > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5.1/userguide/build_environment.html#gradle_system_properties
                     > 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 15s

Versions:

  • Android Studio : Iguana | 2023.2.1 Patch 1.
  • expo : ~47.0.14
  • React Native : 0.70.8
  • @react-native-async-storage/async-storage: ^1.23.1

Any help here would be appreciated

“PKIX path building failed” means there is some problem with the HTTPS handshake.
Maybe your Java version has a problem like disabled TLS protocols or missing root certificates or something like that.
Try running Gradle with a different Java installation.
If that doesn’t help, you can try with --debug and --refresh-dependencies at the same time to maybe get more information about the failed download.
If that doesn’t help, you could enable the java.net.debug message to get detailed information about the HTTPS handshake to find out what goes wrong exactly.

Hi,
Thanks for the reply. You lead me down the correct path - it was a security issue and not the code / gradle itself.
Thanks

1 Like