- Home /
Android SDK
Hello! I am new to all the Android setup and SDK, so I am wondering how I can be able to test my game on my android device. Please don't leave me a link to a unity forums, but instead tell me how. All I know right now is that you need to install Android Studio but I'm not sure where to go from there :( Please help, thanks
Well sorry, but why typing what has already been typed:
https://docs.unity3d.com/$$anonymous$$anual/android-GettingStarted.html
The only difference is step two where you use the sdk manager from the installed Android Studio ins$$anonymous$$d of the command line version
Answer by lspence812 · Jan 02, 2018 at 09:01 PM
Please follow the steps in this link.
Hi - This tutorial gets you a long way (I have been following it myself today), but it is slightly outdated, to the point where I am now stuck:
The section titled: "Setting up the Android SD$$anonymous$$ Tools" ends with the bullet-point:
Double click the file called android to run it
There is ins$$anonymous$$d an "android.bat" file which states (opening it in an editor) "The "android" command is deprecated. [...] For command-line tools, use tools\bin\sdkmanager.bat"
So - running sdkmanager.bat --list in a cmd ter$$anonymous$$al, gives me:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.Schema$$anonymous$$odule$Schema$$anonymous$$oduleVersion.<init>(Schema$$anonymous$$odule.java:156)
at com.android.repository.api.Schema$$anonymous$$odule.<init>(Schema$$anonymous$$odule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.Sdk$$anonymous$$anagerCli.main(Sdk$$anonymous$$anagerCli.java:117)
at com.android.sdklib.tool.Sdk$$anonymous$$anagerCli.main(Sdk$$anonymous$$anagerCli.java:93)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass($$anonymous$$ Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass($$anonymous$$ Source)
at java.base/java.lang.ClassLoader.loadClass($$anonymous$$ Source)
... 5 more
Note I had followed instructions earlier in the page to install the latest JD$$anonymous$$ (9.0.1) from here: http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html#close
So I'm thinking:
Should I be rebooting after the JD$$anonymous$$ install, or somehow linking this JD$$anonymous$$ version with Unity to make sure the JRE is ok?
$$anonymous$$aybe I should go back and install the full Android Studio - not just these command-line tools as advised in the tutorial. I might have better success with running the Android SD$$anonymous$$ $$anonymous$$anager via the Android Studio?
The tutorial text seemed to imply that the Android SD$$anonymous$$ did not need updating if you had the latest Android OS on your phone (which I do), so I tried ignoring the above and carrying on with the tutorial. However this fais on the Build & Run step:
This seemed hopeful in that at least it offerd an "Update Android SD$$anonymous$$" button, but alas - this results in:
Looking at the console for clues, I see that:
It is using the correct jdk-9.0.1\bin\java.exe, but...
It is ultimately trying to run "android update sdk -a -u -t tool,platform-tool,build-tools-23.0.2"
Which (as above) seems to be outdated.
Any ideas on how to proceed - warmly appreciated!
Haha. Exact same problem. Still trying to figure this issue out. Anyone know what to do?
At least we are literally on the same page :-)
I'm thinking of going back and installing the full Android Studio - maybe there is a more complete environment to manage the Android SD$$anonymous$$'s (or at least invoke the .bat files correctly under the covers.
I am actually doing that right now :) If I say it doesn't work, that doesn't mean it doesn't work, but probably means I did something wrong... I'll make sure to keep you updated if I find a solution!
Ok - So installing Android Studio seems "warmer". After the basic install I can now run the SD$$anonymous$$ $$anonymous$$anager after clicking "Configure->SD$$anonymous$$ $$anonymous$$anager" from the home-screen.
This shows me that Android API 27 is now installed, and I can pick back-versions (I only have 7.0 - Nougat, Platform 24 on my phone). Now installing.
I note that these are going into a different directory (..\AppData\Local\Android\Sdk) - which I will have to point Unity at later.
Answer by leSamo · Jan 02, 2018 at 08:25 PM
When installing Unity you can choose which platforms do you want to build to in the future. You can choose android there and the installer will do everything for you.
Answer by Carson365 · Jan 02, 2018 at 08:34 PM
Oh I guess I wasn't specific enough once I read my queston again. Pretty much I need to be able to test my game on my Android phone. How would I do that? @IeSamo
Connect your phone to your PC and turn on USB debugging (google if you don't know how) in the developer options of your phone. When building press "Build and run".
Ok. Right now I am having trouble getting the SD$$anonymous$$. I downloaded Android Studio, and I went into configure settings and got Android versions Jellybean on up, and got the platform tools, build tools, and the usb driver. I try to put the file in Unity and when I run it, it says cannot find SD$$anonymous$$ or something like that, pretty much the SD$$anonymous$$ file wasn't working. Can you please help me get it? Thanks.
You don't need Android Studio. Just download the SD$$anonymous$$ and then within Unity browse to the location you installed the SD$$anonymous$$ to.
SD$$anonymous$$ Command line Tools. Scroll to the bottom of the page.
It didn't quite work... I downloaded the command line and I extracted it and put the tools folder in Unity. It says "Unable to update the SD$$anonymous$$. Please run the $$anonymous$$anager manually to make sure you have the latest set of tools..." I'm pretty sure to do that, you need to Open the Android.bat file, but it doesn't work. People say it just doesn't work anymore, so I probably need a new way. Any suggestions? Thanks. @Ispence812
Your answer
![](https://koobas.hobune.stream/wayback/20220612145657im_/https://answers.unity.com/themes/thub/images/avi.jpg)