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 only exceptions are Android SDK Build-tools versions higher than version 30. Unity doesn’t support Android SDK Build-tools versions higher than 30.
The following table shows the NDK version that each Unity version supports:
Unity version | NDK version |
---|---|
2019.4 LTS | r19 |
2020.3 LTS | r19 |
2021.2 | r21d |
The following table shows the JDK version that each Unity version supports:
Unity version | 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) |
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, Chrome OS is part of the Android development environment. This means you can deliver new and existing Android applications to Chrome OS. Also, since many Chrome OS devices are laptops or have a laptop mode, you can use features such as mouse and keyboard input. For more information:
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.