- Home /
The question is answered, right answer was accepted
Unable to list target platforms. When I try to build to Andriod on Mac
The environment is Unity5.5 and MacOS10. I can't build to Andriod and get an error:
CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/AndroidSDK/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -
stderr[
Error:Invalid command android
]
stdout[
]
exit code: 64
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.HostView:OnGUI()
I have changed my sdk folder and path for several times, but it still said this. My current setting is:
I am experiencing the same issue with Unity 5.5.1f1 on a PC (Windows 7). $$anonymous$$y paths are correct seem to be correct, but I cannot build the app.
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.7.0_45\bin\java.exe -Xmx2048$$anonymous$$ -Dcom.android.sdkmanager.toolsdir="C:/Users/csb/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.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String error$$anonymous$$sg)
UnityEditor.Android.AndroidSD$$anonymous$$Tools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memory$$anonymous$$B, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String error$$anonymous$$sg)
UnityEditor.Android.AndroidSD$$anonymous$$Tools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memory$$anonymous$$B, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String error$$anonymous$$sg)
UnityEditor.HostView:OnGUI()
When I updated my Andriod Studio to the latest edition(2.3.0.8), everything is O$$anonymous$$ now. You must try it!
Answer by Bigpumkin · Mar 05, 2017 at 01:50 AM
hey @Shulin_S and @CoryButler I found an answer here: https://forum.unity3d.com/threads/unity3d-5-5-0fx-unable-to-list-target-platforms-error.446096/
1) just open https://developer.android.com/studio/index.html
2) scroll down to the bottom of that page
3) go to downloads
5) scroll down to the bottom of that page
4) find Windows "tools_r25.2.3-windows.zip" download and unzip it
5) remove and replace the folder: tools in your SDK folder (the one that looks like this)
5) Enjoy!
Note that you only have to replace the tools folder shown above, not the whole directory - it's about a 200mb download only for the tools folder. (The whole SDK directory is 10 gb.)
This does work perfectly with Unity 5.5.3.f1 - the problem arises when you upgrade Android Studio (April 2017). The above fix does work great.
The zip with the tools has been removed from that website. You can still get it here: -
Windows: https://dl.google.com/android/repository/tools_r25.2.3-windows.zip -
MacOSX: https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip -
Linux: https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
Thank you, Bigpumkin! Actually, I don't know what has happend! But when I updated my Andriod Studio to the latest edition(2.3.0.8), everything is O$$anonymous$$ now.
Thank you for your response! I cannot express to you how grateful I am.
This also helped me after 4 hours of uninstalling everything and reinstalling with ZERO results. I have followed at least 6 other posts with solutions that did not work. I was about to give up when I found this post! Thank you so much!
tl:dr THIS WOR$$anonymous$$S!
This is horrific! I just wasted 1.5 hours of my life trying to set up Android build support on my new $$anonymous$$ac. Unity seriously need to update their Android SD$$anonymous$$ setup guide, it seems to refer to a very old version of that website.
Anyways, thanks a lot for your answer, it seems to work now.
The zip with the tools has been removed from that website. You can still get it here: - Windows: https://dl.google.com/android/repository/tools_r25.2.3-windows.zip - $$anonymous$$acOSX: https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip - Linux: https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
Answer by Pn-io · Feb 13, 2018 at 12:29 PM
@Bigpumkin I am facing similar error after updating Android SDK VERSION: 3.0.1.0, I have also downloaded and replaced that tool folder mentioned in above comment but the error is still there. following is a snapshot of the error.
please help me, I have already wasted 4-5 hours installing and uninstalling SDKs.
The proposed solution for replacing the tools folder did not help me either. But it was worth installing the old Java SD$$anonymous$$ in the x86 version, as everything worked. But, as I suspected, the problem can be solved in another way: install the Android SD$$anonymous$$/ND$$anonymous$$ from the $$anonymous$$icrosoft Visual Studio Community 2017 package. You can leave a new Java SD$$anonymous$$ x64. http://unity3d.ru/distribution/viewtopic.php?f=20&t=42449&st=0&sk=t&sd=a☆t=15
hi, I am able to get out of this issue only after downgrading to unity 5.6.3 from unity 2017.3. None of the solutions mentioned in forums worked for me. now I am having another issue that custom splash screen is not working in gear VR build but at least I m able to publish the build from this version.
Answer by terry213 · May 08, 2017 at 09:48 PM
I got the SDK tools here: https://androidsdkoffline.blogspot.com/p/android-sdk-tools.html
for anyone who needs them.
Answer by oscartn123 · Dec 26, 2017 at 09:29 PM
Now it just says “Android SDK does not include your Target SDK of 25. Please use the Android SDK installation tool to install your target SDK version.”
Answer by vaideeaviji · Feb 01, 2018 at 04:27 PM
I hope this would help you, https://youtu.be/7NdCcjQFHVo
Follow this Question
Related Questions
Unity freezing when trying to build to android? 0 Answers
BuildFailedException: Incremental Player build failed! 2 Answers
Should we download android modules again? 1 Answer
Gradle build failed. 0 Answers
Android Error building Player: CommandInvokationFailure: Failed to re-package resources 1 Answer