Unity - Manual: Android environment setup (2024)

  • Platform development
  • Android
  • Getting started with Android
  • Android environment setup

Getting started with Android

Android Player settings

To create a Unity application for Android, you first need to set up your Unity project to support Android. To support Android, a Unity project requires the following dependencies:

  • The Android Build Support module.
  • The Android Software Development Kit (SDK).
  • The Native Development Kit (NDK).
  • A Java Development Kit. By default, Unity uses OpenJDK.

Before you get started, check Unity’s Requirements and compatibility documentation for Android to make sure you’re aware of any limitations for developing a Unity application for Android.

Installing dependencies

Unity distributes dependencies as modules which means you must use the Unity Hub to install them. You can install them either when you install a new Unity Editor version, or add them to an existing Unity Editor install. To install modules:

  • At install time, refer to Downloading and installing Editors and modules with the Unity Hub.
  • To an existing install, refer to Add modules.

The three modules to install are:

  • Android Build Support
  • Android SDK & NDK Tools
  • OpenJDK
Unity - Manual: Android environment setup (1)

Unity installs Android SDK & NDK Tools and OpenJDK respectively in the SDK, NDK, and OpenJDK folders under /[EditorVersion]/Editor/Data/PlaybackEngines/AndroidPlayer/.

Customizing dependencies

You should use the Unity Hub to install Android SDK & NDK tools and OpenJDK to ensure that you receive the correct versions and configurations. However, there are situations where it’s useful to change the SDK, NDK, or JDK that Unity uses to build applications for Android. For example, if you have multiple versions of Unity with the same dependencies and you don’t want to duplicate the installation of the SDK, NDK, and JDK, you can specify a shared location.

To make Unity use a custom version of a dependency:

  1. Download the custom version of the dependency.
    Warning: Unity only officially supports versions of the OpenJDK, SDK, or NDK that it supplies through the Hub. For more information, refer to Supported dependency versions.
  2. In Unity’s main menu, go to Edit > Preferences > External Tools > Android (macOS: Unity > Settings > External Tools > Android)
  3. Refer to the External tools for Android documentation to understand how to customize the installation of JDK, SDK, NDK, and GradleAn Android build system that automates several build processes. This automation means that many common build errors are less likely to occur. More info
    See in Glossary
    .

Supported dependency versions

This section contains information on which versions of each dependency each Unity version supports. Each version of Unity requires a specific version of the Android NDK and Android JDK, but there are no exact version requirements for the Android SDK.

SDK

Unity relies on tools that the Android SDK provides and different versions of the SDK usually have the same tools available. This means you can use any recent version of the SDK as they all contain the build tools that Unity requires.

The following table shows the supported versions of Android SDK tools installed with each Unity version:

Unity versionSDK tools versionSDK Build tools versionSDK Command-line tools versionSDK Platform tools version
2022.3 LTS26.1.134.0.0632.0.0
2021.3 LTS26.1.132.0.0632.0.0
2020.3 LTS26.1.130.0.2228.0.1

Important: Unity versions 2020.3 and 2021.3 LTS do not support Android SDK Build tools versions 31 and above.

NDK

The following table shows the NDK version that each Unity version supports:

Unity versionNDK version
2022.3 LTSr23b (23.1.7779620)
2021.3 LTSr21d (21.3.6528147)
2020.3 LTSr19 (19.0.5232133)
JDK

The following table shows the JDK version that each Unity version supports:

Unity versionJDK version
2022.3 LTS11 (OpenJDK version 11)
2021.3 LTS11 (OpenJDK version 11)
2020.3 LTS8 (OpenJDK version 1.8)

External Tools for Android

The External Tools section for Android allows you to configure settings for Android development tools used to set up Unity projects on Android devices. To access the External Tools section for Android, go to Edit > Preferences (macOS: Unity > Settings) and then navigate to External Tools > Android.

For general Preferences settings, refer to Preferences.

Unity - Manual: Android environment setup (2)
SettingDescription
JDK installed with Unity(recommended)Indicates whether to use the recommended version of Java Development Kit (JDK) installed with Unity or the custom JDK installation. If enabled, the setting displays the path to the JDK installation folder. To use the custom JDK version, disable this option and click Browse to set the custom JDK installation folder path.
Android SDK tools installed with Unity(recommended)Indicates whether to use the recommended versions of Android SDK tools installed with Unity or the custom SDK tools installation. If enabled, the setting displays the path to the SDK tools installation folder. To use the custom SDK tools version, disable this option and click Browse to set the custom SDK tools installation folder path.
Android NDK installed with Unity(recommended)Indicates whether to use the recommended version of Android Native Development Kit (NDK) installed with Unity or the custom NDK installation. If enabled, the setting displays the path to the NDK installation folder. To use the custom NDK version, disable this option and click Browse to set the custom NDK installation folder path.
Gradle installed with Unity(recommended)Indicates whether to use the recommended version of Android Gradle installed with Unity or the custom Gradle installation. If enabled, the setting displays the path to the Gradle installation folder. To use the custom Gradle version, disable this option and click Browse to set the custom Gradle installation folder path.
Stop Gradle daemons on exitIndicates whether to stop Gradle daemons when the Unity Editor exits. This option is enabled by default and it might help to free up resources on your computer.
Kill ADBAn Android Debug Bridge (ADB). You can use an ADB to deploy an Android package (APK) manually after building. More info
See in Glossary
server on exit
Indicates whether to terminate Android Debug Bridge (adb) server when the Unity Editor exits. This option is enabled by default and it might help to free up resources on your computer.
Kill external ADB instancesIndicates whether to terminate external Android Debug Bridge (ADB) instances. These are separate instances that don’t belong to the Android SDK set from Android SDK tools installed with Unity(recommended) . Multiple ADB instances can conflict with each other and might cause issues when using the Android SDK. For example, when updating the API or during application launches.

Note: This option is enabled by default to prevent collision between different ADB instances.

Maximum JVM heap size, MbyteSpecifies the maximum Java heap size that can be allocated during the Android build process. The value is specified in megabytes and the default value is 4096. You can increase or decrease this value based on your project requirement. Increase this value if you experience heap space errors.
Keystores Dedicated LocationSpecifies the folder path to your Android keystoresAn Android system that lets you store cryptographic key entries for enhanced device security. More info
See in Glossary
. Unity uses this path when signing your Android application during the build process. To set a new path for your application, click Browse and navigate to the folder where you want to store your Android keystores. For more information, refer to Choose the keystore location.

Setting the Android SDK Target API

The Unity Hub installs the latest version of the Android SDK Target API that Google Play requires. If you need to use a more recent version, you can change it in the Android Player Settings. To do this:

  1. Select Edit > Project Settings.
  2. In the Project settings window, select the Player tab, then open Android Player Settings:
    Unity - Manual: Android environment setup (3)
  3. In the Other Settings section, change the Target API Level.
    Unity - Manual: Android environment setup (4)

If you select a target API version newer than the latest installed version, the Unity Android SDK Updater can automatically download and install the new version. Unity displays a prompt and you can choose to either:

  • Automatically download and install the new version of the Android SDK.
  • Continue to use the highest installed version of the Android SDK.

If you select a target API version that isn’t installed and is older than the latest installed version, the Unity Android SDK Updater can’t perform the update and Unity displays an error message. In this case, to update the Android SDK Target API, you must use the Android sdkmanager from either Android Studio or the command-line tool. Regardless of the method you choose, make sure to select the correct Android SDK folder for Unity in the Edit > Preferences > External Tools window. For more information, refer to Customizing dependencies.

Important: On Windows, if you installed the Unity Editor in the default folder (/Program Files/), you must run the sdkmanager with elevated privileges (Run as Administrator) to perform the update.

ChromeOS

In Unity, ChromeOS is part of the Android development environment. This means you can deliver new and existing Android applications to ChromeOS. Also, since many ChromeOS devices are laptops or have a laptop mode, you can use features such as mouse and keyboard input. For more information:

  • On ChromeOS in Unity: ChromeOS.
  • On how to build an Android application for ChromeOS: Building your ChromeOS application.

Getting started with Android

Android Player settings

Unity - Manual: Android environment setup (2024)
Top Articles
Bee Network Announces New Features, Here Is Where You Can Find The Details
A Comprehensive Guide to Data Types in Oracle
What Did Bimbo Airhead Reply When Asked
Metra Union Pacific West Schedule
Amc Near My Location
Craigslist Vans
Kaydengodly
Blanchard St Denis Funeral Home Obituaries
Ymca Sammamish Class Schedule
Midflorida Overnight Payoff Address
Bucks County Job Requisitions
Pitt Authorized User
<i>1883</i>'s Isabel May Opens Up About the <i>Yellowstone</i> Prequel
Premier Boating Center Conroe
Rapv Springfield Ma
Sport Clip Hours
Diablo 3 Metascore
Kaomoji Border
Mineral Wells Independent School District
What Happened To Anna Citron Lansky
Locate At&T Store Near Me
Niche Crime Rate
Wgu Academy Phone Number
Lowes Undermount Kitchen Sinks
Www.publicsurplus.com Motor Pool
Yisd Home Access Center
Craigslist Battle Ground Washington
Valic Eremit
Hctc Speed Test
Arrest Gif
The Boogeyman (Film, 2023) - MovieMeter.nl
Speedstepper
2004 Honda Odyssey Firing Order
Frank Vascellaro
Federal Express Drop Off Center Near Me
Korg Forums :: View topic
Does Iherb Accept Ebt
Western Gold Gateway
Vanessa West Tripod Jeffrey Dahmer
Grapes And Hops Festival Jamestown Ny
How To Get Soul Reaper Knife In Critical Legends
Wsbtv Fish And Game Report
Promo Code Blackout Bingo 2023
Natasha Tosini Bikini
Shell Gas Stations Prices
Rs3 Nature Spirit Quick Guide
Matt Brickman Wikipedia
Bridgeport Police Blotter Today
Rite Aid | Employee Benefits | Login / Register | Benefits Account Manager
Taterz Salad
What Responsibilities Are Listed In Duties 2 3 And 4
Latest Posts
Article information

Author: Jonah Leffler

Last Updated:

Views: 5890

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Jonah Leffler

Birthday: 1997-10-27

Address: 8987 Kieth Ports, Luettgenland, CT 54657-9808

Phone: +2611128251586

Job: Mining Supervisor

Hobby: Worldbuilding, Electronics, Amateur radio, Skiing, Cycling, Jogging, Taxidermy

Introduction: My name is Jonah Leffler, I am a determined, faithful, outstanding, inexpensive, cheerful, determined, smiling person who loves writing and wants to share my knowledge and understanding with you.