- Home /
Can't not set up android sdk path
Hi: I'm learning how to build an android game. i used the App Unity remote 5 to connect my android phone to Unity editor. When i hit "play" button, i got a warning " Set-up Android SDK path to make Android remote work" . If I tried to build the project, what i got is asking me to update Android SDK it popped up a instruction windows said"SDK Plamform Tools version 0.0.0<23.0.0" if I continued click the update button, it showed another warning like this:
then i got three errors:
Error:Invalid command android
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/Java/jdk1.8.0_144\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files/sdk-tools-Adroid\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 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/Java/jdk1.8.0_144\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files/sdk-tools-Adroid\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
i've installed jdk successfully. (i've set up "JAVA_HOME" variable, path and CLASSPATH at Environment Variable, and checked with cmd commend )
About the Android SDK, what I download is "the command line tools", sdk-tools-windows-3859397.zip this zip only contains a folder name "tools", its content includes: 
I store this "tools" folder at location C:\Program Files\sdk-tools-Adroid , at Environment Variable settings , i created: ANDROID_HOME C:\Program Files\sdk-tools-Adroid PATH C:\Program Files\sdk-tools-Adroid
both in user variable and system variable. I tried everything i found, i don't know what to do to make this work, can anyone help me please?
------------Update----------------------------- i installed the whole Android Studio pack, then run the SDK Manager inside the software and update, it finally work. But I still don't know how to make it work by using the SDK command line tools.
@PRI$$anonymous$$4T - I have same problem!!! Uninstalled Android Studio and installed again.
C:\Users\ username\AppData\Local\Android\sdk
I need someone to logon to my laptop with TeamViewer or something so they can help!!!
Paul
Hey there Hope$$anonymous$$aven!
I am still unable to export to android. I use "C:\Users\ username\AppData\Local\Android\sdk" but still no luck.
I am going to look for another solution and will report here in case i find something. Good luck to you my friend and please write here if you have some suggestions. Thank you and greetings PRI$$anonymous$$4T
Answer by HungPark · Jan 15, 2018 at 08:41 AM
Hung Park. I solved this head aching issue very easily. Go to the following site.
Https://developer.android.com/studio/releases/platform-tools.html
Then, go to download
Then, select one for your platform(one of Windows, Mac or Linux)
Then, unzip(platform - tools - latest - windows(This is for me))
Then, you’ll get the following file.
platform-tools-latest-windows(AndroidSDK)
Then, change its path for your use.
Hope helpful to you.
Answer by Bunny83 · Sep 23, 2017 at 02:20 PM
You have to manually run the SDK Manager of the Android SDK. It's usually in the root folder of your SDK folder. It's named "SDK Manager.exe"
Once started the manager should first update itself to the newest manager version and also download a list of available packets. Make sure you install (check them in the list) the latest
Android SDK Tools
Android SDK Platform-tools
Android SDK Build-tools
You also need to have at least one Android version installed. Currently i only have Android 8.0.0 (API 26)
Make sure you have all those selected and finally click Install. If you have never updated the SDK it can take quite a bit of time.
In case the manager has problems installing you should first make sure you closed Unity and make sure the Android Debug Bridge (adb.exe) doesn't run in the background (check the Task$$anonymous$$anager and kill it if it's running).
If you still have issues you may need to start the SD$$anonymous$$ $$anonymous$$anager with ad$$anonymous$$ rights. (right click --> Run as Ad$$anonymous$$istrator).
It's generally recommended to install the Android SD$$anonymous$$ in a "simple" and short path. By "simple" i mean avoid spaces and other special characters in folder names. I usually install it in a folder inside the root of one of my drives. Currently i have it here: `C:\Android`
Thank you Bunny83. The problem is that the sdk-tools-windows-3859397.zip file which i downloaded from the official website, is zip file , it is a no-need-to install version. It has only one folder tools after i upzipped it. there is no SD$$anonymous$$ $$anonymous$$anager.exe. and this is the command line tools version that the Unity tutoral recommend. i saw some other tutorials showed that there are SD$$anonymous$$ $$anonymous$$anager.exe, Android SD$$anonymous$$ Platform-tools folder and some other files in their the command line tools , but $$anonymous$$e version is not. in this case, do i have to download the Android Studio ins$$anonymous$$d? i guess there should be a SD$$anonymous$$ $$anonymous$$anager.exe file in it.
Answer by PRIM4T · Nov 24, 2017 at 11:39 PM
Hey there Ben, i have the exact same problem and i also wasnt able to find a solution. I also tried this solution ( https://answers.unity.com/questions/652886/android-sdk-build-error-1.html ) but it didnt work for me.
Hope someone can help out here! Thanks in advance and greetings PRIM4T
Did you try downloading full package with Android Studio? It is the best way to ensure you get Android SD$$anonymous$$ as it is really easy to choose what SD$$anonymous$$ you want from Android Studio itself to download.
Hey Shakecaine! Thank you for replying.
I installed and reinstalled Android Studio like 5 times now...same thing with unity itself. Still no success. I am now in the process of downloading every version of the sdk via the android studio, maybe this will work. Gonna come back if i got some results.
Greetings PRI$$anonymous$$4T
Hi PRI$$anonymous$$4T: I hope the problem you met have been solved. In my case, I installed the full package of Android Studio and it workes. if you still got the problem, maybe you need to ensure the sdk path in Unity setting and your Enviromenet Veriable is C:\Users\ username\AppData\Local\Android\sdk; and the Android Studio install path is C:\Android. this may work. Good luck and take care.
Hey there, Gentleman!
I finally found a solution following this video: https://www.youtube.com/watch?v=1yLDxI$$anonymous$$uRlo
The solution to my problem is at 50 seconds of the video. For some reason i had to replace the "tools" folder with the files which you will find in the description of the video.
Thank you everyone for trying to solve it!
Stay creative and greetings PRI$$anonymous$$4T
Answer by vivek4dhiman · Apr 14, 2020 at 02:30 PM
This might help https://www.youtube.com/watch?v=ftPxYWjFIVk
Answer by harperrhett · Aug 06, 2020 at 10:43 PM
Hi, I fixed this problem by downloading Android SDK tools, downloading the SDK version I wanted, and then dragging that version into the place where Unity stores its SDK versions (if you've downloaded any at all). I changed my default location for Android but if you find your folder then the versions are under platforms, and you can drag your desired version to "C:\Program Files\Unity\Hub\Editor\2020.1.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms" but that path will change depending on the version of Unity you have as well as which drive Unity is stored on. Make sure that in the Unity editor under "preferences>external tools" you have "Android SDK tools installed with Unity" turned on. Anyways good luck, I spent hours figuring this out.
Your answer
Follow this Question
Related Questions
Unable to list target platforms error for Android build on 5.5.2f1 1 Answer
Android SDK not found or invalid unity. 3 Answers
Export to android: CommandInvokationFailure: Failed to build apk. 1 Answer
Error when building for Android, SDK path is incorrect while it is. 0 Answers
BuildFailedException: Incremental Player build failed! 2 Answers