Version: 2023.2
Language : English
Gradle for Android
Unity Launcher Manifest

Android App Manifest

The Android App Manifest contains information about an Android application. Each application has a single Android App Manifest XML file at the root of the source set called AndroidManifest.xml. The Android operating system and digital distribution services (for example, Google Play) use Android App Manifests to find information, such as the application’s name, the application’s entry point, Android version support, hardware features support, and application permissions. For more information about the Android App Manifest file, and for a list of settings that it configures, see the Android Developer documentation on Android App Manifests.

To generate an Android App Manifest to represent an application, Gradle merges manifest files from a variety of sources. This includes:

  • Unity Library Manifest: A manifest file that Unity produces which configures Unity Player activities. For more information, see Unity Library Manifest.
  • Unity Launcher Manifest: A manifest file that Unity produces which configures the application that wraps the Unity library. For more information, see Unity Launcher Manifest.
  • Plug-inA set of code created outside of Unity that creates functionality in Unity. There are two kinds of plug-ins you can use in Unity: Managed plug-ins (managed .NET assemblies created with tools like Visual Studio) and Native plug-ins (platform-specific native code libraries). More info
    See in Glossary
    manifests
    : Manifest files that represent plug-ins such as Android Archives (AAR) or Android Library Projects.

For information on how Unity uses these manifest files to generate an Android App Manifest, see Generating an Android App Manifest.

Generating an Android App Manifest

The Android application build process generate an Android App Manifest file for the application. To do this:

  1. Unity uses the Unity Library Manifest as a template for the Android App Manifest. If you override the Unity Library Manifest, Unity uses the file you specify as the template.
  2. Unity updates the Unity Library Manifest and Unity Launcher Manifest files with information such as permissions, configuration options, and the features that the application uses.
  3. 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
    merges the Unity Library Manifest, Unity Launcher Manifest, and plug-in manifests into one Android App Manifest file.

You can view the Android App Manifest file inside the output Android App Bundle (AAB) or Android Package (APK) using the Android Studio APK Analyzer, or another third-party tool such as Apktool.

Important: You cannot edit the Android App Manifest file in the 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
or AAB. For information on how to override the contents of an Android App Manifest, refer to Modify Gradle project files.

Permissions

Unity automatically adds the necessary permissions to the manifest based on the Android Player Settings and Unity APIs that your applications calls from C# scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary
. For example:

If a plug-in requires a permission that is declared in its manifest, Unity automatically adds the permission to the final Android App Manifest during the Gradle merge stage. Note that Unity includes all Unity APIs that the plug-ins use in the permissions list.

You can use the Android Runtime Permission System to request permission at runtime, instead of specifying permissions in the Android App Manifest.

For more information about permissions, see Android developer documentation on Android App Manifest Permissions.

Gradle for Android
Unity Launcher Manifest