androidhaxeopenfl

Error compiling android with Lime/OpenFL. Unable to get Java version (Windows 10)


I get this at the end of my build:

Unzipping C:\Users\jdoughty\.gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0\gradle-2.10-bin.zip to C:\Users\jdoughty\.gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '10.0.1'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Build halted with errors.

This confuses me slightly because it seems like it has the version... but that's my primitive understanding of what's going on.

This is the contents of my .lime/config.xml:

<?xml version="1.0" encoding="utf-8"?>
<config>

    <section id="defines">


    </section>
    <define name="ANDROID_NDK_ROOT" value="C:\android-ndk-r15c-windows-x86_64\android-ndk-r15c" />
    <define name="ANDROID_SDK" value="C:\Users\jdoughty\AppData\Local\Android\Sdk" />
    <define name="JAVA_HOME" value='"C:\Program Files\Java\jdk-10.0.1"' />
    <define name="ANDROID_SETUP" value="true" />

</config>

Solution

  • I think the Android SDK support doesn't support Java 10 (or 9) just yet - try downgrading to Java 8.

    There's reports of a similar issue here: https://github.com/facebook/react-native/issues/17688