Search code examples
react-nativechirp

chirp-react-native run-android failing for Java 11 and 12?


Tried to build chirp-react-native with Java 12 and Java 11. Will not build.

If I drop down to Java 1.8 AND set my gradle distributionUrl to gradle-4.8-all.zip in chirp-react-native/android/gradle/wrapper/gradle-wrapper.properties, the package compiles and installs correctly and I think it runs correctly.

However if it's an easy fix I'd prefer to use a current JDK. Has anyone successfully built chirp-react-native using Java 12?

Steps to reproduce:

With Java 12 set in my JAVA_HOME env variable (/Library/Java/JavaVirtualMachines/jdk12-0.1.jdk)

react-native run-android fails with this error:

Could not determine Java version from 12.0.1

If I drop down to Java 11 as JAVA_HOME, I get a similar error message:

Could not determine Java version from 11.0.3

With Java 1.8 and Gradle 4.8, everything appears to build, install and run properly.


Solution

  • This comment describes the reason for this error - https://github.com/facebook/react-native/issues/22487#issuecomment-443759776

    You might be able to upgrade the gradle version in the android/build.gradle file.