0

Unable to list target platforms. Please make sure the android sdk path is correct

I have searched for this error. and many suggested me to downgrade the "tools" folder in the android sdk. So I did. But It didn't work...

So did anyone gone throgh with different solution????

thanks.

Below is my full error messages


Error:Invalid command android

UnityEditor.HostView:OnGUI()


CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. C:\Program Files (x86)\Java\jdk1.8.0_131\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/AndroidSDK\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 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()


CommandInvokationFailure: Unable to update the SDK. Please run the SDK Manager manually to make sure you have the latest set of tools and the required platforms installed. See the Console for more details. C:\Program Files (x86)\Java\jdk1.8.0_131\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/AndroidSDK\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" android update sdk -a -u -t tool,platform-tool,build-tools-23.0.2

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()


Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. C:\Program Files (x86)\Java\jdk1.8.0_131\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/AndroidSDK\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


External Tool Settings

Community
  • 1
  • 1
  • Are you using 5.6? – Programmer May 10 '17 at 07:31
  • yes My unity is 5.6.0f. – user2257636 May 10 '17 at 08:16
  • Is this the first time you are building for Android? Can you post screenshot of your Unity Preference settings where you put the SDK url? – Programmer May 10 '17 at 08:20
  • yes it is my first time building for Android.and I just uninstalled my unity to install again. But my SDK URL was like shown in the errors.. was my JDK url – user2257636 May 10 '17 at 08:27
  • I just want to see the screenshot of how you set it up in Unity Editor. There is a SDK, JDK and NDK(Optional). Can you post that? Edit-->Preferences...-->External Tools then scroll to where it says Android and take a screenshot of it. – Programmer May 10 '17 at 08:32
  • yeap reinstalling doesn't work either. – user2257636 May 10 '17 at 08:35
  • I uploaded the screenshot. – user2257636 May 10 '17 at 08:40
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/143846/discussion-between-user2257636-and-programmer). – user2257636 May 10 '17 at 08:46
  • I am gonna write here the solution cause I know that someone will definitely search for this. I am sure. I had to check SDK manager and tools to uninstall SDK Tools 25 and Android SDK Tools 26.Install something below. Unity does not simply support. Download Unity 20017 beta for a possible fix. Again thx to @Programmer – user2257636 May 10 '17 at 10:16
  • Modified that into the other answer to put the answer into one place instead of fragmented answers. This will make it easier for other people to find a solution since there are different solutions for this issue. – Programmer May 10 '17 at 10:20

0 Answers0