Get SpatialOS



Setting up Android support for the GDK

Get the dependencies for developing Android games

  1. Follow the steps in Get the dependencies and additionally install Android build support for Unity.
  2. Install Android Studio:
    At the Choose Components stage of the installation, be sure to select Android Virtual Device.
  3. 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.
  4. Java Platform, Standard Edition Development Kit (JDK) - download and install the latest version.
  5. (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.
  6. (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:

  1. Open your Unity Editor.
  2. It should automatically detect your project. If it doesn’t, select Open, navigate to <path-to-your-project>/workers/unity and 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.
  3. In your Unity Editor, go to File > Build Settings. Select Android and then Switch Platform.
  4. 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 C:/Program Files/Java
Mac: run which java to retrieve the path.
NDK (Optional) Use the directory path that you noted down earlier when extracting the Android NDK.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums