The Android Manifest is an XML file which contains important metadata about the Android app. This includes the package name, activity names, main activity (the entry point to the app), Android version support, hardware features support, permissions, and other configurations.
For more information about the Android Manifest file, see the Android Developer documentation on Android Manifests.
In Unity 2019.3 and newer versions, the Android 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 project that Unity generates has two template manifest files:
isGame
settingWhen Unity builds your app, it automatically generates the Android manifest files, following the steps below:
manifmerger
class to merge plug-in manifests into the main manifest.Although Unity generates a correct manifest for your app, you might want direct control over its contents.
To use an Android manifest you created outside of Unity, import your Android Manifest file to the following location: Assets/Plugins/Android/AndroidManifest.xml. This overrides the default LibraryManifest.xml.
In this situation, Unity merges the manifests of your Android libraries into your main manifest, and ensures that the resulting manifest’s configuration is correct. For full control of the manifest, including permissions, you must export the Project and modify the final manifest in Android Studio.
Note: Unity only supports the [launchMode - singleTask](https://developer.android.com/guide/topics/manifest/activity-element.html#lmode)
launch mode.
Unity automatically adds the necessary permissions to the manifest based on the Android Player Settings and Unity APIs that your app calls from the script. For example:
Network
classes add the INTERNET permissionHandheld.Vibrate
) adds VIBRATEInternetReachability
] property adds ACCESS_NETWORK_STATELocationService
) adds ACCESS_FINE_LOCATIONWebCamTexture
APIs add CAMERAA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More infoMicrophone
class adds RECORD_AUDIONetworkDiscovery
and NetworkTransport.SetMulticastLock
add CHANGE_WIFI_MULTICAST_STATEFor more information about permissions, see Android developer documentation on Android Manifest Permissions.
If your plug-ins require a permission by declaring it in their manifests, Unity automatically adds the permission to the resulting Android manifest during the merge stage. All Unity APIs that plug-ins call also contribute to the permissions list.
If your app is running on a device with Android 6.0 (Marshmallow) or later and also targets Android API level 23 or higher, your app uses the Android Runtime Permission System.
The Android Runtime Permission System asks the user to grant permissions while the app is running, instead of when they first install the app. App users can usually grant or deny each permission when the app needs it while the app is running (for example, requesting camera permission before taking a picture). This allows an app to run with limited functionality without permissions. You can use the Android.Permission
class in Unity to check whether the user granted or denied specific permissions. If a permission your app needs has been denied, you can inform the user why the app needs it and ask them to approve the permission. For more information, see documentation on Requesting Permissions.
Your app normally prompts the user to allow what Android calls “dangerous” permissions on its startup. For more information, see Android developer documentation on dangerous permissions. If you don’t want your app to ask for permissions on startup, you can add the following code to your manifest, in either the Application or Activity sections:
<meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" />
Note: This code suppresses the permission dialog the app shows on startup, but you must handle runtime permissions carefully to avoid crashes. This is an advanced method of dealing with runtime permissions.
For more information about the Runtime Permission System and handling permissions, see Android developer documentation on Requesting Permissions.
To examine the final Android manifest that Unity generates for your app, open the Temp/StagingArea/AndroidManifest.xml file after you build your Project but before you close the Unity Editor.
The Manifest is stored in binary format in the output package (.apk). To check the contents of a Manifest inside an .apkThe Android Package format output by Unity. An APK is automatically deployed to your device when you select File > Build & Run. More info
See in Glossary, you can use the Android Studio APK Analyzer, or another third-party tool such as Apktool.
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.