Search code examples
javareact-nativefedora-25

Problems using React Native for Android on Fedora 25


I am having problems with React Native for Android running on Fedora 25. I have followed the instructions in the Getting Started guide.

I have installed all the dependencies such as Node, the React Native CLI, Android Studio and the Android SDK. I have installed the necessary packages in the Android SDK Manager and created an Android Virtual Device.

To test my installation I ran the following commands.

react-native init AwesomeProject
cd AwesomeProject
react-native run-android

Running the project fails with an SSLHandshakeException (see output snippet below)

Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Downloading https://services.gradle.org/distributions/gradle-2.4-all.zip

Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
...

I suspect this is not so much a React Native problem than a Java Runtime or even a Fedora-specific problem but I'm not sure. There's certainly no mention of this issue in the React Native troubleshooting.

My java version is as follows:

openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b16)
OpenJDK 64-Bit Server VM (build 25.111-b16, mixed mode)

Incidentally I can access the Gradle URL listed above in a web browser and I am on a home machine so no proxy server to content with.

Thank you.


Solution

  • This problem seems to be specific to 1.8.0_111 and/or Fedora 25

    upgrading to 1.8.0_121-b14 from the official repository resolved it for me - a dnf update should suffice