Unity does not find android sdk
Hi I wanted to create a simple cardboard app I upgraded Unity to 5.5.0, downloaded GoogleVRForUnity package I installed Android Studio as it seems te be the only way to get android sdk When I try to build my app, Unity says
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_31\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity533\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
In the C:/Program Files/Android/sdk folder there is at least one platform (android-25) I noticed that the address in the error message has a mix of slash (/) and antislash () so I corrected in the preferences/external tools but it did not help I downgraded to Unity 5.3.3 with no luck I tried to use the command line to type everything correct but it is waiting for parameters, I cannot figure out what... I'm getting crazy...could some one please help ?
These days, I have been avoiding myself to install program into the C: and actually, to get the SD$$anonymous$$ you dont need the whole Android Studio, like I did I only downloadaded the SD$$anonymous$$ $$anonymous$$anager
For your problem, I suggest you remove then reinstall to another disk other than C, and then remove your Unity also, and start everything freshly
Answer by jamesMak · Apr 13, 2017 at 02:51 PM
Hi @Ariane98
Go to the official Android Studio download page (https://developer.android.com/studio/index.html) and download the command line tools from the very bottom of the page. Then replace the tools folder from your sdk folder (in your case : C:/Program Files/Android/sdk\tools) with the one you just downloaded.
This will work and you will be able to export from Unity.
HOWEVER : You should keep in mind that updating from android studio will replace the tools folder you just added. To avoid that you can have two sdk folders eg :
1) C:/Program Files/Android/sdk 2) C:/Program Files/Android/sdkUnity (just make a copy of number 1)
Then do the aforementioned process with the second sdk/tools folder and use that for Unity. If you import in Android Studio you will be asked about the sdk folder you want to user. Both will work.
Your answer
Follow this Question
Related Questions
[OS X] Unable to select Android SDK folder because it ends with .app 4 Answers
How to replace space keyboard with a simple tap on Android? 0 Answers
When launching the app, the screen blacks out on Android 8.0 (API 26) above. 1 Answer
SDK and NDK Tools not downloading, no messages of unresponsive server? 0 Answers