Skip to content
Advertisement

Use custom Manifest file and permission in Unity?

Im currently trying to program a little game for android with Unity3D. Because I want a visible status bar, I modified the AndroidManifest in the Project Folder (C:UsersPublicDocumentsUnity ProjectsProjectNameTempStagingArea) like this :

<application android:theme="Theme.Light.NoTitleBar" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner">

But everytime i generate the APK, unity changes the Android Manifest to this :

<application android:theme="@style/UnityThemeSelector" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner">

Unity3D does change my modified Manifests everytime?

Advertisement

Answer

You are modifying the wrong AndroidManifest file. That AndroidManifest from <ProjectName>TempStagingArea you are modifying is generated by unity each time you build your project.

To use a custom AndroidManifest file, you have to put your custom AndroidManifest file at <ProjectName>AssetsPluginsAndroid.

1.Go to <UnityInstallationDirecory>EditorDataPlaybackEnginesAndroidPlayerApk, Copy the AndroidManifest.xml file to your <ProjectName>AssetsPluginsAndroid

2.Open the copied Manifest file from <ProjectName>AssetsPluginsAndroid and add your manifest.

In your particular case, add <application android:theme="Theme.Light.NoTitleBar" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner"> to it. Save, Build and Run.

Unity will now use that AndroidManifest file. If you get crash or any other problem, then Unity does not want you to change that.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement