Search Issue Tracker

Fixed in Unity 2018.3



Found in

Issue ID




Android builds fail with Java 9 JDK and Unable to list target platforms error




Priority: 2Necessary for shipping a final release


Severity: 2Core functionality majorly impacted

With the latest public versions of Unity (2017.1.1f1), Android Studio/SDK tools(26.0.2), and JDK (Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode), Android builds failed early on with:

Error:Invalid command android
CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct.
See the Console for more details. Error building Player: CommandInvokationFailure: Unable to list
target platforms. Please make sure the android sdk path is correct. See the Console for more details.

A similar problem (same error message, but different cause) has been reported about 6 months ago:

In my case, downgrading to JDK 8 fixed the problem.

Reproduced with:
2017.3.0b4, 2017.2.0f3, 2017.1.2f1, 5.6.3p4, 5.5.5f1

Response avatar


May 18, 2018

Unfortunately there are compatibility issues between JDK9 and JDK10 and Android SDK.
The bugs have been reported to Google, we are working on a full-featured fix.
As a workaround, for now please UNINSTALL JDK9/10 and INSTALL only JDK8 (64-bit).
We apologize for the inconvenience caused.

Feel free to check the status at the forums as well:

Comments (30)

  1. 58bbee5441c8e58d4211c56e7f204f14?d=mm


    Dec 11, 2017 07:09

    Same problem.
    Please fix.

  2. D110b8d4ab97eb154e59267fd113599d?d=mm


    Dec 11, 2017 06:08

    5.6.3p1 didn't work too

  3. 42488fb398144043ffe8e1f5913eec92?d=mm


    Dec 09, 2017 20:54

    I tried almost all ways that I found here and anothers threads. But, unfortunately, nothing is working. So sad! :(

  4. 6e891fffcd6b651fca09f7939b5ee4c6?d=mm


    Nov 18, 2017 07:59

    This has been going on since Android was a thing, with hacky ways of getting it to work. I don't think it's ever going to get fixed lol.

  5. 23f30b318eb233c7706d6d9afebc781d?d=mm


    Nov 07, 2017 22:01

    If you are using JDK 9 and trying to build for Android in Unity - you're most likely to have your build failed, with message like "Unable to list target platforms" - "Error:Invalid command android".

    We are working together with Google on fixing this issue - it requires fixes on Unity side, but also Android SDK tools need to be updated to be compatible with latest Java.

    In the meanwhile, we recommend using Java 8 (JDK 8). You can have both Java installations side-by-side, just need to configure Unity Preferences => External Tools => JDK to point to your JDK 8 installation.

    We apologize for the inconvenience caused!
    Your Unity Mobile team

  6. F7556ef1c9ebb3e979511562105383a1?d=mm


    Oct 27, 2017 16:58

    Linking with one more such occurrence on JDK 9.0.1 -

  7. F5a8b5c6bbd6afcd0c4ebc282d83c6b6?d=mm


    Oct 25, 2017 21:40

    Seconding this - even having JDK 9 installed on the system causes the build to fail with this error, regardless of what JAVA_HOME or the Unity JDK setting is.

    Removing JDK9 entirely from /Library/Java/JavaVirtualMachines corrects the issue.

    (Unity 5.6.4p1/macOS 10.13)

  8. C1b26b10cbaeb0be72a8232a1056d19d?d=mm


    Oct 12, 2017 23:06

    Experiencing same problem. Build fails with JDK 9.

    Setting JAVA_HOME to JDK 1.8 fixed the problem.

  9. B43713f110765796e7ec14537f772213?d=mm


    Oct 12, 2017 19:00

    I have same problem.
    JDK 9 100% error on build!
    whats going on?
    The problem is in JDK or Unity?

  10. D1738665e6a05b68159d278c89807267?d=mm


    Oct 09, 2017 13:48

    On the scratch system macos high sierra 10.13 I've installed JDK 9 on by homebrew and Unity 2017.2.0f2 didn't work with it.

    After it downloaded JDK 8 from Oracle site but and changed path in Unity settings but the issue didn't solved.
    After adding export JAVA_HOME=`/usr/libexec/java_home -v 1.8` to ~/.bash_profile it didn't work too.

    Only full removing JDK 9 solved the issue by command: brew cask uninstall jdk

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.