# Permission requiired you must approve this premission in app settings:storage

**URL:** <https://forums.unrealengine.com/t/permission-requiired-you-must-approve-this-premission-in-app-settings-storage/656530>\
**Category:** Mobile\
**Tags:** unreal-engine, UE5-0, question\
**Created:** [September 26, 2022, 10:35am UTC](https://forums.unrealengine.com/t/permission-requiired-you-must-approve-this-premission-in-app-settings-storage/656530 "2022-09-26T10:35:59Z")\
**Posts on this page:** 1\
**Showing post:** 73

<div class="post-metadata">

**Author:** ![Paul\_Eckhardt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Paul\_Eckhardt](https://forums.unrealengine.com/u/Paul_Eckhardt)\
**Post date:** [August 3, 2024, 12:30am UTC](https://forums.unrealengine.com/t/permission-requiired-you-must-approve-this-premission-in-app-settings-storage/656530/73 "2024-08-03T00:30:09Z")

</div>

Thanks to [Anton Rassadin’s help doc](https://rassadin.net/android-external-storage-access/), @RealAero and @ericwa I was able to get saves working with Unreal 5.4.3 on the Meta Oculus Quest 3. Saves weren’t working for me after I’d upgraded to 5.4. I could not save save files on my quest. Here’s all the relevant settings I’m aware of, and how i’ve set them, hopefully this is helpful to see it all in one place.

Build: shipping or development  
_Android_  
_APK Packaging_  
Minimum SDK Version 32  
Target SDK Version 32  
useExternalFilesDir: True

_Advanced APK Packaging_

_Extra Permissions_  
android.permission.WRITE\_EXTERNAL\_STORAGE  
android.permission.READ\_EXTERNAL\_STORAGE

_Launch Images_  
Show launch image: True

Android SDK settings:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/6/026b00a556e21504b503cd42cd67721f8038de98.png)

I was getting this issue from MQDH meta quest developer hub / adb logs.:

` java.lang.IllegalArgumentException: Primary directory UnrealGame not allowed for content://media/external_primary/file; allowed directories are [Download, Documents]`

Here’s the full log error:

```auto
18:17:16.873 2146 19214 E MediaProvider : java.lang.IllegalArgumentException: Primary directory UnrealGame not allowed for content://media/external_primary/file; allowed directories are [Download, Documents]
18:17:16.873 2146 19214 E MediaProvider : at com.android.providers.media.MediaProvider.ensureFileColumns(MediaProvider.java:3370)
18:17:16.873 2146 19214 E MediaProvider : at com.android.providers.media.MediaProvider.ensureUniqueFileColumns(MediaProvider.java:3021)
18:17:16.873 2146 19214 E MediaProvider : at com.android.providers.media.MediaProvider.insertFile(MediaProvider.java:3780)
18:17:16.873 2146 19214 E MediaProvider : at com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:4364)
18:17:16.873 2146 19214 E MediaProvider : at com.android.providers.media.MediaProvider.insert(MediaProvider.java:4064)
18:17:16.873 2146 19214 E MediaProvider : at com.android.providers.media.MediaProvider.insertFileForFuse(MediaProvider.java:8375)
18:17:16.873 2146 19214 E MediaProvider : at com.android.providers.media.MediaProvider.insertFileIfNecessaryForFuse(MediaProvider.java:8470)
18:17:16.878 2146 10646 W MediaProvider : Forgot to handle a top level directory in getContentUriForFile?

```

I added one file, and edited another:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/1/791389c5bb0027240c37e9ec9517829b3898f9c9.png)

AndroidSanitizePermissions\_UPL.xml:

```auto
<root xmlns:android="http://schemas.android.com/apk/res/android">
  <androidManifestUpdates>
	  <loopElements tag="meta-data">
	  <setStringFromAttribute result="NameTagValue" tag="$" name="android:name"/>
	  <setBoolIsEqual result="UseExternalFilesDirElement" arg1="$S(NameTagValue)" arg2="com.epicgames.unreal.GameActivity.bUseExternalFilesDir"/>
	  <if condition="UseExternalFilesDirElement">
		<true>
		  <removeElement tag="$"/>
		</true>
	  </if>
	</loopElements>

	<addElements tag="application">
	<meta-data android:name="com.epicgames.unreal.GameActivity.bUseExternalFilesDir" android:value="true" />
	</addElements>
  </androidManifestUpdates>
</root>

```

Then create a link to this in your build script: \*the project name in this case is NitroGrid

NitroGrid.Build.cs:

```auto
using UnrealBuildTool;

public class NitroGrid : ModuleRules
{
	public NitroGrid(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" });

		PrivateDependencyModuleNames.AddRange(new string[] { });

		// 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
		
		// Allow saves on android
		if (Target.Platform == UnrealTargetPlatform.Android)
        {
            string manifestFile = System.IO.Path.Combine(ModuleDirectory, "AndroidSanitizePermissions_UPL.xml");
            AdditionalPropertiesForReceipt.Add("AndroidPlugin", manifestFile);
        }
	}
}

```

After making those changes, saving save objects worked great.

I did not need to request save permissions with this code, possibly because I installed via the .bat file generated with the APK file, which grants permissions. If you’d using a different install method, you may need to request permissions like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/7/467ebd675fa98f4fe34af39554add00ee523d2ff.png)

---

_[View the full topic](https://forums.unrealengine.com/t/permission-requiired-you-must-approve-this-premission-in-app-settings-storage/656530)._
