- Home /
Can Unity build android without android studio ?
I wish to know if Unity can build an Andoid apk file ( to upload on the google play ) without external tools such as Android Studio ?
When I try to do so, Unity asks me to give the path to the sdk root folder even tho I did include the android package when downloading Unity. I have seen people do so without issues and am wondering if I did not mistackenly set an option somewhere .
Must I download Andoid Studio or can Unity do the build without it ?
Answer by JavierRuidoRosa · Jul 09, 2018 at 04:33 PM
The Unity Android extension provides the tools to compile Android APKs with no effort, but it needs access to the Android SDK, which must be downloaded separately. The easiest way to get and update this SDK is through Android Studio, and the other way is through command prompt and downloading the android tools package from the Android Studio download page. I recommend the first option.
Check this guide and you'll have your Android game deployed in no time!
Sorry for the late reply, I tryed a few times but I keep getting into the same error when trying to build : Unable to list target platforms. Very unsure why I am getting this error but after looking at tutorials I think it's because the last version of Android Studio ( and the downloaded SD$$anonymous$$s ) are incompatible with the last version of Unity but I could very easely be proven wrong. Do you use the last version of Android Studio ?
Yes, I use it. That error you mention might be because it can't find the android platforms. You have to make sure of a few things:
You've installed Android SD$$anonymous$$ and Java Development $$anonymous$$it and configured your environment variables to point to these two SD$$anonymous$$s:
User variables:
ANDROID_HO$$anonymous$$E: YourPathToAndroidSD$$anonymous$$
System variables:
PATH: WhateverItHadbefore;YourPathToAndroidSdk\platform-tools;YourPathToJD$$anonymous$$\bin
CLASSPATH: WhateverItHadBefore;YourPathToJD$$anonymous$$\lib
You've updated your installed platforms through Android SD$$anonymous$$, which can be accessed opening Android Studio and going to File -> Settings... -> Appearance & Behavior -> System Settings -> Android SD$$anonymous$$
You've referenced the SD$$anonymous$$s in the Unity Editor. You can do it going to Edit -> Preferences... -> External Tools. You have to fill the JD$$anonymous$$ and SD$$anonymous$$ blanks with the path to both kits.
nd the solution ( at last ). Had to replace the tools directory that had been installed by android studio with a previous version. Unity is not compatible with the latest at all. Details can be seen here : http://devlog.markhlavac.com/2017/06/30/installing-android-sdk-for-unity3d-using-sdk-tools-and-cli/