Change AndroidManifest.xml for AppLab submission.
I'm trying to get my app to be submitted into the AppLab, but I'm running into issues where no matter what I try, I always get those permissions active in my build:
android.permission.READ_EXTERNAL_STORAGE
android.permission.READ_MEDIA_AUDIO
android.permission.READ_MEDIA_VIDEO
android.permission.READ_MEDIA_IMAGES
android.permission.ACCESS_MEDIA_LOCATION
android.permission.READ_MEDIA_IMAGE
android.permission.READ_MEDIA_VISUAL_USER_SELECTED
My app currently does not use any of those permissions, but I am currently using Oculus Interaction SDK (The old integration), so I have two options, to delete all the code that is tied to those permissions, or use another straighter (to the point) solution like modifying the manifest directly, I tried the following code using custom AndroidManifest.xml file checked on Player Settings:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.CompanyName.MyApp"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" tools:node="remove" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" tools:node="remove" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" tools:node="remove" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" tools:node="remove" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" tools:node="remove" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGE" tools:node="remove" />
<application android:label="@string/app_name" android:icon="@mipmap/app_icon" android:allowBackup="false">
<activity android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity" android:excludeFromRecents="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" />
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only" />
<meta-data android:name="com.oculus.vr.focusaware" android:value="true"/>
</application>
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
</manifest>
But it simply did not work, not matter what I tried.
I also tried building directly on Android Studio, but it did not work either. I don't know why the custom manifest is not working, well, actually it works but specifically the record audio part.
The other permissions simply stay there. I hope that maybe some good developer can help me with this issue.
Unity version: 2021.3.30f1, Using this packages:
Thank you very much for your patience 😊