Monday, June 10, 2013

 

Deploying to Android with Unity3D

Want to build Android games in C# or javascript without learning Java? Doing it in Unity3D is free. Yet getting Unity3D setup for Android deployments was tricky the first time I did it. It was even more of a challenge when I did it the 2nd time 4 months later. Hopefully these steps will make it easier for you or for when my third time comes around.

1. Download the Android SDK Tools, not the ADT Bundle! The SDK is shown under "use an Existing IDE". http://developer.android.com/sdk/index.html

2. Run the SDK Tools.
2.1 If the Android SDK Tools request it, install the 32bit version of the Java Platform Standard Edition JDK. (Installing only the 64bit version causes Unity Error: Error building Player: Win32Exception: ApplicationName='java.exe', CommandLine='-Xmx1024M...) http://www.oracle.com/technetwork/java/javase/downloads/index.html
2.2 You may need to manually set the JAVA_HOME Windows PATH variable https://confluence.atlassian.com/display/CONF26/Set+JAVA_HOME+variable+in+Windows

3. After the Android SDK has been installed be sure to start "SDK Manager.exe" from the installation folder.
3.1 Keep the defaults checked and check any additional Android versions that your older devices are running.
3.2 Click "Install ## packages..." in the lower right.
3.3 Accept the license and install. (It took me about 20 minutes for this to install 13 packages).
3.4 You do not need System Images to create an *.apk with Unity. However, dependencies for System Image packages are now complete, click "Install #packages..." again if you want to use the Android emulator.
3.5 [troubleshooting] If the Android SDK *.exe you downloaded contains r22 in it's file name (and you want to use Unity 4.1.3) you need to copy the contents of the /build-tools/17.0.0/ folder to the /platform-tools/ folder. This was suggested by "jvil" on http://forum.unity3d.com/threads/176737-unknown-error-when-building-simple-scene

4. Start up Unity3D and open Edit -> Preferences...
4.1 Click External Tools
4.2 Click Browse... next to "Android SDK Location"
4.3 Find the same folder that "SDK Manager.exe" is in from step #3 and click "Select Folder".
4.4 exit the Preferences window.

5. Click File -> "Build Settings..."
5.1 Make sure platform "Android" is selected.
5.2 Click "Player Settings..."
5.3 Find the Unity Inspector -> Per-Platform Settings -> Settings for Android -> "Other Settings".
5.4 Set the "Bundle Identifier" and "Minimum API Level".

6. Click File -> "Build Settings..." if you closed it.
6.1 Click Platform "Android".
6.2 Click "Switch Platform"
6.3 Click Build

Additional details for setting up the Android SDK to work with a device and creating a test application: http://blog.rabidgremlin.com/2012/03/10/tutorial-creating-your-first-unity-android-app/

Labels: ,


Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]