Setting up Android support for the GDK
Get the dependencies for developing Android games
- Follow the steps in Get the dependencies and additionally install Android build support for Unity.
- Install Android Studio:
At the Choose Components stage of the installation, be sure to select Android Virtual Device.
- Install Android SDK:
Once the Android Studio installation is complete, open Android Studio and select Configure > SDK Manager.
Select the version you intend to develop your game for.
Select Apply to download and install the matching Android SDK version.
- Java Platform, Standard Edition Development Kit (JDK) - download and install the latest version.
- (Optional) Download and unzip Android NDK r16b.
You only need this if you want to build for Android using IL2CPP. Extract it to a directory of your choice. Note down this file path as you need to specify the path in your Unity Editor later.
- (Optional) Unity Remote - this is Unity’s solution for faster development iteration times.
Set up your Unity Editor
Most of your interactions with the GDK happen inside your Unity Editor. To get started:
- Open your Unity Editor.
- It should automatically detect your project. If it doesn’t, select Open, navigate to
<path-to-your-project>/workers/unityand select Open.
If you don’t have a SpatialOS Unity project you can use the FPS Starter Project or the Blank Starter Project to get started. If you are using one of these projects, please ensure that you’ve completed the setup steps for those projects before continuing these steps.
- In your Unity Editor, go to File > Build Settings. Select Android and then Switch Platform.
Still in your Unity Editor, add the file paths Unity needs via the External Tools window. To do this:
- on Windows, go to Edit > Preferences
- on MacOS, go to Unity > Preferences.
In the Android section of the External Tools window, input the paths to the SDK, JDK and NDK. The easiest way to ensure that Unity reads the file path correctly is to use the browse option:
|Field||How to find the path|
|SDK||You can find the SDK location by opening Android Studio and selecting Configure then SDK Manager.|
|JDK||Windows: default path is
|NDK||(Optional) Use the directory path that you noted down earlier when extracting the Android NDK.|