Unable to detect android sdk for building app

I’ve researched this problem a lot, however all the solutions don’t work.

Building my program says I need to setup the android sdk, however I already did that!

In edit/preferences/external tools, I have it correctly linking to the Android SDK. I installed the package on my desktop to make it easier, (installing it to native folders also didn’t work). I tried selecting other folders, however it kept requesting I point it to the sdk folder, so it’s obvious it’s now correctly pointed.

The problem is it STILL keeps saying I haven’t correctly selected the android sdk folder. I have no further ideas how to fix this.

Here’s the console info:

PlayerSettings Validation: Requested build target group (16) doesn’t exist; #define symbols for scripting won’t be added.
UnityEditor.PlayerSettings:SetScriptingDefineSymbolsForGroup(BuildTargetGroup, String)
ICode.FSMEditor.EnableICodeScripting:.cctor() (at Assets/Unitycoding/ICode/Scripts/Editor/EnableICodeScripting.cs:33)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()

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/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“C:/Users/kathyShane/Desktop/sdk\tools” -Dfile.encoding=UTF8 -jar “C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar” -

stderr[
Error:Invalid command android
]
stdout[

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/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“C:/Users/kathyShane/Desktop/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

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/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“C:/Users/kathyShane/Desktop/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

SOLVED:

Looked up exit code:64. Apparently it’s a problem with the tools folder. Followed link to download old toolset from site. replaced tools folder and it now works.

The strange thing is this is suppose to be fixed with current version, so i dont understand why same problem persisted.

Would you give me the link to the old toolset site, please?

I have the same error
Edit: I think its these Site

1 Like

check if there is new version of unity available or not, if yes try installing the new version and while installing check the android SDK and NDK check box by clicking a drop down like icon in the Unity Hub. If you are already using the latest version then just go to the unity hub and check the android build support and Android SDK and NDK from the drop down and install it and restart the unity and try to build it. I think it will work. ! thank u