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:
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.
Unity distributes dependencies as modules which means you 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:
The three modules to install are:
Unity installs Android SDK & NDK Tools and OpenJDK respectively in the SDK
, NDK
, and OpenJDK
folders under /Unity/Hub/Editor/[EditorVersion]/Editor/Data/PlaybackEngines/AndroidPlayer/
.
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:
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.
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 since they all contain the build tools that Unity requires.
Important: The minimum Android SDK Build-tools version that Unity supports is version 32.
The following table shows the NDK version that each Unity version supports:
Unity 版本 | NDK 版本 |
---|---|
2019.4 LTS | r19 |
2020.3 LTS | r19 |
2021.2 | r21d |
2021.3 LTS | r21d |
2022.2 | r23b |
The following table shows the JDK version that each Unity version supports:
Unity 版本 | JDK version |
---|---|
2019.4 LTS | 8 (OpenJDK version 1.8) |
2020.3 LTS | 8 (OpenJDK version 1.8) |
2021.2 | 8 (OpenJDK version 1.8) |
2021.3 LTS | 8 (OpenJDK version 1.8) |
2022.2 | 11 (OpenJDK version 11) |
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:
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:
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, see Customizing dependencies.
Important: On Windows, if you installed the Unity Editor in the default folder (/Program Files/
), you must run the sdkmanager
with elevated privilege (Run as Administrator) to perform the update.
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:
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.