Stephen Maloney did a great video for this, but we thought we would do a text version -> https://youtu.be/vMBwlkoCf_o

Links we recommend going through to set up your environment:

https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/Android/GettingStarted/

https://docs.unrealengine.com/4.26/en-US/ProductionPipelines/DevelopmentSetup/VisualStudioSetup/

To get your Meta Quest 2 app onto the Oculus Store, you will most probably come into the issue of having additional permissions automatically ‘on’ in your build.

Unreal Engine allows you to ADD permissions, but not remove them.

You have to turn your app into a Cpp app so you can get to the source files. To do this, make a Cpp file in your project through the editor. You should set up Visual Studio for this. If you are at this stage for app permissions, we assume you should know about visual studio etc… but if you don’t please email and we can help.

Once this is done, go to your Build.CS file

Add a using statement ‘using System.IO’ <- this is so your project can read files on the system, the xml file we will reference, using the PATH keyword.

// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.IO;

Add the manifest file reference to the target

var manifest_file = Path.Combine(ModuleDirectory, "AndroidSanitizePermissions_UPL.xml");
AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", manifest_file));

Now make the AndroidSanitizePermissions_UPL.xml. Make a text file and set the extension to XML. (the code is below)

<?xml version="1.0" encoding="utf-8"?>
<root xmlns:android="http://schemas.android.com/apk/res/android">
  <androidManifestUpdates>
  
    <removePermission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <removePermission android:name="android.permission.ACCESS_WIFI_STATE" />
    <removePermission android:name="android.permission.READ_PHONE_STATE" />
    <removePermission android:name="com.android.vending.CHECK_LICENSE" />
    <removePermission android:name="android.permission.GET_ACCOUNTS" />
    <removePermission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
    <removePermission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <removePermission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <removePermission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
    
  </androidManifestUpdates>
</root>

Remove the ones you don’t need – we did alot of trial and error.

Now add your AndroidSanitizePermissions_UPL.xml file to the following directories.

Project->Source

Project->Source->’ProjectName’

The video link above tells to only put it in the source folder which would crash, but for some reason we put it in both and it worked fine. It works, but we don’t know how lol

That should be all you need to do to remove App permissions for the store.

See below for some images.

// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.IO;
public class "YOUR PROJECT NAME": ModuleRules
{
    public "YOUR PROJECT NAME"(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
    
        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
        PrivateDependencyModuleNames.AddRange(new string[] {  });
        var manifest_file = Path.Combine(ModuleDirectory, "AndroidSanitizePermissions_UPL.xml");
        AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", manifest_file));
        
        // Uncomment if you are using Slate UI
        // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
        
        // Uncomment if you are using online features
        // PrivateDependencyModuleNames.Add("OnlineSubsystem");
        // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
    }
}
<?xml version="1.0" encoding="utf-8"?>
<root xmlns:android="http://schemas.android.com/apk/res/android">
  <androidManifestUpdates>
    <removePermission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <removePermission android:name="android.permission.ACCESS_WIFI_STATE" />
    <removePermission android:name="android.permission.READ_PHONE_STATE" />
    <removePermission android:name="com.android.vending.CHECK_LICENSE" />
    <removePermission android:name="android.permission.GET_ACCOUNTS" />
    <removePermission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
    <removePermission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  </androidManifestUpdates>
</root>