Search Issue Tracker

Fixed in 2018.3

Fixed in 2017.4, 2018.2

Votes

80

Found in

Issue ID

956425

Regression

No

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

Android

-

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: https://issuetracker.unity3d.com/issues/android-build-fails-when-the-latest-android-sdk-tools-25-dot-3-1-version-is-used

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

  1. Response avatar

    Yury-Habets

    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: https://forum.unity.com/threads/java-9-jdk-9-support-by-unity-android.499354/

Comments (31)

  1. D366b614e23d2e4fb288083d60e58f95?d=mm

    emma1993

    Jul 11, 2019 07:01

    Yes, many of the unity3d users are facing this issue. The given information in this article is really very informative also can check https://oniton.com/blog/windows-10-startup-folder-not-working/ for more information in details.

  2. Bde1a4d11bd1a8ef2835ede7866c5436?d=mm

    renyuzhuo

    Sep 28, 2018 08:34

    export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
    open -n /Applications/Unity/Unity.app

    From: https://github.com/RWebRTC/Blog/issues/37

  3. Aaf8805b48065e2001fae0e2f5a92a98?d=mm

    Ricachet

    Sep 13, 2018 14:21

    As of 9/12 Unity will tell you to download JDK 8 if you try to use 10. Thanks for this warning :)

  4. 436fd511d64fe9e162ce3df240b2b57d?d=mm

    Pranay1Knight

    Jul 23, 2018 19:07

    Thank you problem solved, It's working.

  5. B203d401b0d01c03a39935cf2b63f5fd?d=mm

    Thiago-Paiola

    Jul 23, 2018 08:47

    My solution was uninstalling Java 10 and reinstalling Java 8 on Windows 10.

  6. Ac8ffc316a0ea86a057fd6263926cd03?d=mm

    love_for_world

    Jun 26, 2018 09:50

    in my case this version is working good jre1.8.0_172.
    here is link to download
    http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

    COMMENT from Yury Habets: Unity requires JDK and not JRE. Please don't promote this solution, it may have worked because of coincidence.

  7. B20704082e2f22d251a100c86a622f7d?d=mm

    turgayyuzen

    May 06, 2018 06:10

    thank you

  8. 929b582ceb4921ea732c3e4bef3e9f98?d=mm

    jl008

    Apr 23, 2018 13:36

    Unity version: 2017.4.1f1
    JDK version: 10.0.1

    Error:
    Failed to compile resources with the following parameters:
    -bootclasspath "C:/apps/android-sdk\platforms\android-27\android.jar" -d "C:\temp\DemoAppUnity_6.7.8\DemoApp\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\Company\ProductName\R.java" "com\vj\isdemo\R.java" "com\vj\isdemo\resources\R.java"
    warning: [options] source value 6 is obsolete and will be removed in a future release
    warning: [options] target value 1.6 is obsolete and will be removed in a future release
    warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
    3 warnings

  9. 3477317ecb29910f08d531302e2ca1f0?d=mm

    grrrrrrg69

    Apr 16, 2018 03:52

    ps. Unity 5.3.4f1 (64-bit)

Add comment

Log in to post comment

All about bugs

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