Remove Permissions Android Manifest

Hello!

I need help removing certain permissions from an Android Packaged game for release on Oculus Quest. I have been unable to find any reliable solution anywhere guiding me in any valuable direction on how to do this simple and required task before any publishing.

I created a ManifestRequirementsOverride.txt, that includes NO permissions, but AndroidManifest is not being updated and still includes these permissions. Modifying AndroidManifest doesn’t work and is not recommended, so how the hell are we supposed to do this? Why does Unreal Engine not include a field to enter permissions to REMOVE or EXCLUDE from the Packaged app, instead of the entirely useless “Extra Permissions” field, considering I seem to already have all concievable permissions enabled by default.

How do you REMOVE permissions from a Packaged App…
This app is being published for Oculus Quest.
I need NO permissions, and the permissions that are preventing me from publishing are:
READ_EXTERNAL_STORAGE and ACCESS_MEDIA_STORAGE

If you are able to help in any way, THANK YOU!

2 Likes

I managed to find the solution to this based on help from Unity people.

By adding this to your Extra Tags for manifest node:

xmlns:tools="http://schemas.android.com/tools"

(ignore the trailing “>” at the end in this picture: )
351421-extratags.png

You can use the “tools” attributes in your RequirementsManifestOverride.txt.
This allows you to add attributes such as: tools:node=“remove”.

Then add this in your RequirementsManifestOverride.txt:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" tools:node="remove" />

This worked in removing the permissions in my case.

Since I could find little helpful information on this myself.
I’m leaving this here in case it helps someone else!

7 Likes

Does this work with Blueprint projects?

Yes

For anyone else just blindly copying what they see in the first code box, remove the trailing >! The contents of the Extra Tags box should read:

xmlns:tools="http://schemas.android.com/tools"

Hopefully this saves someone 10 minutes.

2 Likes

@lbowes_1 @AquaRex Where the txt file should be located?

None of that worked for me, I had to change AndroidManifest manually and use gradle build bat to compile APK with changes. Only this way it works with Unreal Engine 5.3

1 Like

Can you post a tutorial?

I will try to make it for you, but not sure this is suitable for publishing purposes.

I managed to make it work with UPL, and the permissions I couldn’t get rid of were aded by another UPL from admob goodies plugin. So I had to modify that.

Can you please share with me how have you managed to work with UPL? I cannot find any working tutorial or instruction for that matter.

Thanks.

Do what it’s in this tutorial, and change var manifestfile to string manifestfile.

If you have permissions that you removed in UPL still appear in AndroidManifest.XML your UPL gets merged with another UPL from a plugin most likely or unreal source code.

Search from where that permission is getting added, you need to search every UPL file and rebuild the plugin with your changes or unreal from source.

I don’t think it’s from the engine’s code it’s 99% from a plugin.

1 Like