Hi, this can be fixed in a C++ project. First of all, go to the Source/PROJECT_NAME
folder and create the CustomAndroidManifest.xml
file with the following code inside:
<?xml version="1.0" encoding="utf-8"?>
<root xmlns:android="http://schemas.android.com/apk/res/android">
<androidManifestUpdates>
<removePermission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<removePermission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<loopElements tag="activity">
<setStringFromAttribute result="activityName" tag="$" name="android:name"/>
<setBoolIsEqual result="isTargetActivity" arg1="$S(activityName)" arg2="com.epicgames.unreal.GameActivity"/>
<if condition="isTargetActivity">
<true>
<addAttribute tag="$" name="android:maxAspectRatio" value="2.8"/>
</true>
</if>
</loopElements>
</androidManifestUpdates>
</root>
Then go to the PROJECT_NAME.Build.cs
file and add the following code:
if (Target.Platform == UnrealTargetPlatform.Android)
{
var manifestFile = Path.Combine(ModuleDirectory, "CustomAndroidManifest.xml");
AdditionalPropertiesForReceipt.Add("AndroidPlugin", manifestFile);
}
This worked for me in UE 5.5.1