unable to locate android sdk

Error building Player: Exception: android (invokation failed)
ERROR: unknown error
cmd:android list target -c
stdout;
stderr:
Exception in thread “main” java.lang.NullPointerException
at SDKMain.main(SDKMain.java:62)

I want to build an .apk file but unity is looking for android-sdk-windows, ihave a sdk bu i got that error…

pls. help

Here is what i did:
I downloaded this:

http://developer.android.com/sdk/index.html

Then i presses Download.

I took the SDK folder from the .zip, and placed it on my Desktop (you dont have to do this, thats just how i did it).
And then i went to Edit > Preferences > Extended Tools.
And then i choose the folder on my desktop that was named SDK.

Then after i made the game (didnt export it yet).
Then i went in File > Build Settings...
Choose the Android, and clicked "Switch Platform", waited for that, and pressed "Build".
Then choose where i wanted the .apk file to be (I had my phone plugged to the computer).
I choose my phone, selected the Internal SD, and pressed "Save".

Then i went on my Phone, used a File Manager to find the file. and then i ran the program.
My phone installed, and i was able to test/play the game.

I hope this can help you with how you do it.
I once had trouble with it myself :slight_smile:

Hi everybody,

If I choose the folder where Android Studio (https://developer.android.com/studio/index.html) is installed, there is an error too. Maybe I installed something wrong?
Then I tried to insert the path like you said it, Guzaii, but it dosn’t work either.

Have anybody another alternative?

Ist this path where Android Studio is installed (C:\Program Files\Android\AndroidStudio) not the right path?

I don’t know what to do. Thank you in advance :slight_smile:

EDIT: Problem is fixed. I insert the wrong path. I didn’t know that Android Studio installed the SDK on another path than the Android Studio programm files. May it helps other people who have the same problem :slight_smile:

If you are a newb at unity like me then you get stuck because you dont realise you still need to download the android sdk, just downloading the android plugin is not the complete job.
N3K Unity Android Build - How to - Unity 3D [Tutorial] - YouTube goes through it step by step.
hope that helps

Hi, @cyrillegedoria. In my experience, it all has to do with having a version of Android SDK and tools which is compatible with Unity.

I have managed to sort out this exact same error by using the following combination of products:

Unity 5.3.5f1

Path | Version | Description | Location

build-tools;23.0.2 | 23.0.2 | Android SDK Build-Tools 23.0.2 | build-tools/23.0.2/
emulator | 26.0.3 | Android Emulator | emulator/
patcher;v4 | 1 | SDK Patch Applier v4 | patcher/v4/
platform-tools | 26.0.0 | Android SDK Platform-Tools | platform-tools/
platforms;android-20 | 2 | Android SDK Platform 20 | platforms/android-20/
platforms;android-23 | 3 | Android SDK Platform 23 | platforms/android-23/

tools | 24.4.1 | Android SDK Tools | tools/

Hope this helps.