Search Issue Tracker

Fixed in 2017.1.0f3

Fixed in 5.4, 5.5, 5.6

Votes

39

Found in

5.5.2f1

2017.2.0f3

Issue ID

888859

Regression

Yes

Android Build fails when the latest Android SDK Tools 25.3.1 version is used

Android

-

How to reproduce:
1. Update Android SDK Tools to 25.3.1
- In Mac open Android Studio -> Check for updates and update Android Studio version (might be not necessary)
- In Android Studio -> Preferences -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools
2. Create a new Unity project
3. Build and run on Android device
Result: Build fails "CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. ..."

Reproducible: 5.5.2p2, 5.6.0b11, 2017.1.0a3

Note: I haven't been able to reproduce this issue on Windows machine. As after update via Android Studio, SDK Manager still doesn't see SDK Tools 25.3.1 version and uses 25.2.5

Workaround for the customers.

1) just open https://developer.android.com/studio/index.html
2) scroll down to the bottom of that page
3) go to downloads
4) scroll down to the bottom of that page
5) find Windows "tools_r25.2.3-windows.zip" download and unzip it
5) find MacOSX "tools_r25.2.3-macosx.zip" download and unzip it.
6) In the SDK path replace the tools folder.

FIXED:
Unity versions: 5.4.5p2, 5.5.3p3, 5.6.0p3, 2017.1.0b3
SDK Tools have to be updated to 26.x.x

Comments (133)

  1. 3e9be70e147378a21bd23e279cc4867c?d=mm

    dhidle

    Oct 23, 2017 03:50

    I just lost about 4hours to this as well on version 2017.3.0b5 "Unable to list target platforms."
    with the latest version of the sdk. The link is no longer listed for the old version but I managed to find it in some of the other unity posts on this issue.

  2. B7447d15dfad86103dc5fc94ea1250f1?d=mm

    arada

    Oct 20, 2017 20:19

    I read all comments here and lost whole day and still can not create Android APK.
    Use Unity 2017.2.03f, Windows 10,
    Unity > Edit > Preferences is pointing correct folder for SDK and JDK.
    JDK latest version 1.9.1

    For Android SDK I have already downgrade tools to 25.2.5 version - but I see can not make it by hand because we can see below, some command lines want call still latest version and it create error!

    CommandInvokationFailure: Failed to re-package resources.
    C:\Users\xxxx\AppData\Local\Android\sdk\build-tools\26.0.2\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "C:/Users/xxxx/AppData/Local/Android/sdk\platforms\android-21\android.jar" -F bin/resources.ap_

    I need clean instruction how setup all parts of software for build Android APK file.
    Before I used Unity 5xx and never had this troubles.

  3. Edbd5778c6d7a67d6b113770b291b460?d=mm

    Reloque

    Oct 17, 2017 22:43

    Getting the same error. Fixed partly by the workaround, but now bugging out on an error stating:

    "could not determine java version from '9.0.1' "

    Basically meaning that building for Android on my config, Win 10 Pro, Unity 2017.2.0f3, JDK 9.0.1 is broken.

  4. Eadead78338df238825a401cacbc5ce0?d=mm

    toddwong

    Oct 17, 2017 14:14

    I'm getting this error with Unity 2017.2.0f3

    CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
    C:/Program Files/Java/jdk1.8.0_144\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/xxx/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

    stderr[
    Error:Invalid command android
    ]
    stdout[

    ]
    exit code: 64
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

  5. 8d6b0b2c25a96881308d17b6787f4459?d=mm

    ercion

    Oct 12, 2017 14:10

    Happening to me as well on 2017.1.1f1.

  6. B289b63605fec99475950bc1ea1800c9?d=mm

    sebagork

    Oct 10, 2017 04:34

    With Unity 2017.1.1f1 on Windows i had to downgrade SDK tools folder to tools_r25.2.5 and JDK to jdk-8u144.
    The JDK 9 caused me errors.

  7. 0ab0e0dd9045cf3aee720a781e7e2851?d=mm

    georkai

    Oct 08, 2017 20:43

    Not fixed in 2017.1.1f1 on Windows either. I just imported my project from 5.5.2f1 where everything worked fine and I cannot build the app. Initially I got an error about merging manifests and as soon as I resolved it, by adding tools:replace="icon, label" on one of them, I get an error about not being able to sign in application. Apparently there is something wrong with the keystore. I could try replacing the keystore but this is not a solution that I would like to go with (still would not resolve the problem for apps that are already published). Nothing fixes the issue. I have tried any solution found so far (updated Android Sdk and build tools, I actually removed Android Studio and Android Sdk and downloaded and installed them again, replaced tools inside Android Sdk with the ones provided for Windows by Google, switched to Gradle build, tried using previous versions of build tools and API levels). Any suggestions?

  8. D9e03baedcda5e12e145bbbfa6604d79?d=mm

    gazinventor

    Oct 07, 2017 23:07

    Not fixed in 2017.1.1f1 on Mac OSX. Trying the workaround now. Grrrrr

  9. 82f083514552ea9ee3856bd9ca6ea770?d=mm

    matterama

    Oct 04, 2017 03:27

    Yes...still in 5.6.3p2. JDK 8 or 9, no difference. Going backwards fixed it, but yes, please fix this Unity!

  10. 919dfcb032e623eda0554d17a6071a1f?d=mm

    winterkewl

    Oct 01, 2017 22:02

    I can't believe this is still marked as fixed and yet the above work around is the only "Fix" that actually works. . . COME ON UNITY... FIGURE THIS OUT FOR REAL.

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.