Version: 2021.3
Android용 Gradle
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-in 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. Gradle 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 APK or AAB. For information on how to override the contents of an Android App Manifest, see Overriding an Android App Manifest.

권한

Unity는 Android 플레이어 설정과 C# 스크립트에서 애플리케이션이 호출한 API를 기준으로 매니페스트에 필수 권한을 자동으로 추가합니다. 예를 들면 다음과 같습니다.

  • Network 클래스는 INTERNET 권한을 추가합니다.
  • Handheld.Vibrate와 같은 진동을 사용하면 VIBRATE가 추가됩니다.
  • InternetReachability 프로퍼티는 ACCESS_NETWORK_STATE를 추가합니다.
  • LocationService와 같은 위치 관련 API는 ACCESS_FINE_LOCATION을 추가합니다.
  • WebCamTexture API는 CAMERA를 추가합니다.
  • Microphone 클래스는 RECORD_AUDIO를 추가합니다.

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.

Android용 Gradle
Unity Launcher Manifest
Copyright © 2020 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961