# How can I add "android:exported" attribute to SplashActivity part in AndroidManifest.xml with an API-31 project?

**URL:** <https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799>\
**Category:** Mobile\
**Tags:** unreal-engine, Android, UE4, UE4-27, question\
**Created:** [August 28, 2022, 1:07pm UTC](https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799 "2022-08-28T13:07:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZemmaiSamurai\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZemmaiSamurai\_1](https://forums.unrealengine.com/u/ZemmaiSamurai_1)\
**Post date:** [August 28, 2022, 1:07pm UTC](https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799/1 "2022-08-28T13:07:02Z")

</div>

I cannot deploy an project whose API Level is 31 on Android in accordance with this requirement.

> **[Meet Google Play's target API level requirement  |  Android Developers](https://developer.android.com/google/play/requirements/target-sdk)**

**[Background]**  
Packaging a vanilla project for test has succeeded with editing some files (explain it later), but I cannot deploy it on device.  
The error part when launching the game is as below:

> **Summary**
>
> > LogPlayLevel: Failure [DELETE\_FAILED\_INTERNAL\_ERROR]  
> > LogPlayLevel: Took 0.1758856s to run adb.exe, ExitCode=1  
> > LogPlayLevel: Running: C:\Users\username\AppData\Local\Android\Sdk\platform-tools\adb.exe -s 27191JEGR25829 install “C:\Users\username\Documents\Unreal Projects\MyProject2\Binaries/Android\MyProject2-arm64.apk”  
> > LogPlayLevel: adb: failed to install C:\Users\username\Documents\Unreal Projects\MyProject2\Binaries/Android\MyProject2-arm64.apk: Failure [INSTALL\_PARSE\_FAILED\_MANIFEST\_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl666559365.tmp/base.apk (at Binary XML file line #55): com.epicgames.ue4.SplashActivity: Targeting S+ (version 31 and above) requ  
> > ires that an explicit value for android:exported be defined when intent filters are present]  
> > LogPlayLevel: Performing Streamed Install  
> > LogPlayLevel: Took 3.7226355s to run adb.exe, ExitCode=1  
> > LogPlayLevel: Error: ERROR: Installation of apk ‘C:\Users\username\Documents\Unreal Projects\MyProject2\Binaries/Android\MyProject2-arm64.apk’ failed: [INSTALL\_PARSE\_FAILED\_MANIFEST\_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl666559365.tmp/base.apk (at Binary XML file line #55): com.epicgames.ue4.SplashActivity: Targeting S+ (version 31 and a  
> > bove) requires that an explicit value for android:exported be defined when intent filters are present]  
> > LogPlayLevel: Performing Streamed Install  
> > LogPlayLevel: (see C:\Users\username\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+UE\_4.27\Log.txt for full exception trace)  
> > LogPlayLevel: AutomationTool exiting with ExitCode=35 (Error\_AppInstallFailed)  
> > LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 61.801483  
> > LogPlayLevel: BUILD FAILED  
> > PackagingResults: Error: 起動に失敗しました！ Failed to Install app

To fllow the instruction, I found the code creating the xml in _Engine\Source\Programs\UnrealBuildTool\Android\UEDeployAndroid.cs_.

> **Summary**
>
> ```auto
> if (bShowLaunchImage)
> {
> // normal application settings
> Text.AppendLine("\t\t<activity android:name=\"com.epicgames.ue4.SplashActivity\"");
> Text.AppendLine("\t\t android:label=\"@string/app_name\"");
> Text.AppendLine("\t\t android:theme=\"@style/UE4SplashTheme\"");
> Text.AppendLine("\t\t android:launchMode=\"singleTask\"");
> Text.AppendLine(string.Format("\t\t android:screenOrientation=\"{0}\"", Orientation));
> Text.AppendLine(string.Format("\t\t android:debuggable=\"{0}\">", bIsForDistribution ? "false" : "true"));
> Text.AppendLine("\t\t\t<intent-filter>");
> Text.AppendLine("\t\t\t\t<action android:name=\"android.intent.action.MAIN\" />");
> Text.AppendLine(string.Format("\t\t\t\t<category android:name=\"android.intent.category.LAUNCHER\" />"));
> Text.AppendLine("\t\t\t</intent-filter>");
> Text.AppendLine("\t\t</activity>");
> Text.AppendLine("\t\t<activity android:name=\"com.epicgames.ue4.GameActivity\"");
> Text.AppendLine("\t\t android:label=\"@string/app_name\"");
> Text.AppendLine("\t\t android:theme=\"@style/UE4SplashTheme\"");
> Text.AppendLine(bAddDensity ? "\t\t android:configChanges=\"mcc|mnc|uiMode|density|screenSize|smallestScreenSize|screenLayout|orientation|keyboardHidden|keyboard\""
> : "\t\t android:configChanges=\"mcc|mnc|uiMode|screenSize|smallestScreenSize|screenLayout|orientation|keyboardHidden|keyboard\"");
> }
> 
> ```

**[WHAT I DID]**

1. Decapitalized the packange name. I read it must be lower case somewhere on the Internet.  
com.YourCompany.[PROJECT] → com.comp.prj

2. Renamed two “d8” files to “dx”. The previous errors are that they were missing:

- AppData\Local\Android\Sdk\build-tools\31.0.0\d8.bat
- AppData\Local\Android\Sdk\build-tools\33.0.0\lib\d8.jar

1. Raised gradle version 3.5.3 to 4.0.0 by editing _UE\_4.27\Engine\Build\Android\Java\gradle\build.gradle_.  
I confirmed that an API 31 project can be deployed on Android Studio, and just imitated the gradle. This change was affected, but probably no meaning for this problem.

**[SETTINGS]**  
UE4.27 and Android Studio 4.0.

Project Settings:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/f/bef7e62b1207dce2f7971c6dbd0fd63069b12f70.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/e/4fef19577d634c1286a64c8bde27786e78c7920e.png)

I set android:exported=“ture” for UE4.GameActivity, of coure.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/7/3/e734b15888d0e909b3e89785f99dab1b40aa8d65.png)

**[Questions]**  
I think it would be successful or get just some similar errors for other tags like _activity_ if I added one line _Text.AppendLine(“\t\t android:exported="true"”);_ into _com.epicgames.ue4.SplashActivity_ part and could build it.

So my questions are:

1. Are my procedure and estimate correct?

2. If 1. is yes, is it possible to build only C# code on UE4 engine? I don’t want to take much time to fully build UE4.

3. If 1. is no, please tell me a right method.  
Even if 1. is yes, any other solution will be very welcome.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![dev.ue.games](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dev.ue.games/32/466816_2.png) [@dev.ue.games](https://forums.unrealengine.com/u/dev.ue.games)\
**Post date:** [August 29, 2022, 9:00am UTC](https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799/2 "2022-08-29T09:00:34Z")

</div>

if you are using a engine from source … there is a solution here [Pack a game for android without installing android studio (+update android 12)](https://forums.unrealengine.com/t/pack-a-game-for-android-without-installing-android-studio-update-android-12/492029)

---

<div class="post-metadata">

**Author:** ![ZemmaiSamurai\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZemmaiSamurai\_1](https://forums.unrealengine.com/u/ZemmaiSamurai_1)\
**Post date:** [September 4, 2022, 1:19am UTC](https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799/3 "2022-09-04T01:19:25Z")

</div>

It turned out that it is unnecessary to edit _UEDeployAndroid.cs_ . To avoid crash on startup, unchecking the item like _display splash image_ (idk the sentence in English) in UE4 settings is enough. When I need splash screen, I will create the one on ue4.

Then, you will get the error “_Failed to open descriptor file_”. I also found the way around this problem. The main reason causing this problem is your app’s accessibility to the other files in Android. So, you need to give your UE4 application more authority. Follow this way:

1. Deploy project with bat file created by _files-\>package project-\>Android-\>some platform_.
2. Enable all accessibilities in settings on your Android or with command line.

This is a bit tedious, but it will work for your apps 🙂

---

<div class="post-metadata">

**Author:** ![WimbleSoft](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wimblesoft/32/582012_2.png) [@WimbleSoft](https://forums.unrealengine.com/u/WimbleSoft)\
**Post date:** [October 14, 2022, 12:22pm UTC](https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799/4 "2022-10-14T12:22:22Z")

</div>

> [@You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set. This file can't be installed on Android 12 or higher](https://forums.unrealengine.com/t/you-uploaded-an-apk-or-android-app-bundle-which-has-an-activity-activity-alias-service-or-broadcast-receiver-with-intent-filter-but-without-android-exported-property-set-this-file-cant-be-installed-on-android-12-or-higher/272856/56):
>
> Inside MyGame.Build.cs public MyGame(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); PrivateDependencyModuleNames.AddRange(new string[] { }); // Uncomment if you are using Slate UI // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); PrivateDependencyModuleNames.AddRange(new string[] { "…

---

<div class="post-metadata">

**Author:** ![AlanCruz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlanCruz](https://forums.unrealengine.com/u/AlanCruz)\
**Post date:** [January 4, 2023, 7:01pm UTC](https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799/5 "2023-01-04T19:01:58Z")

</div>

Worked Thanks man! You save my work

---

<div class="post-metadata">

**Author:** ![MeloinUnreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MeloinUnreal](https://forums.unrealengine.com/u/MeloinUnreal)\
**Post date:** [June 6, 2023, 1:28pm UTC](https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799/6 "2023-06-06T13:28:36Z")

</div>

After adding property to activity settings dont forget to delete Android folder and Build/Android in Intermediate folder of your project

---

<div class="post-metadata">

**Author:** ![ZemmaiSamurai\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZemmaiSamurai\_1](https://forums.unrealengine.com/u/ZemmaiSamurai_1)\
**Post date:** [December 17, 2023, 12:28pm UTC](https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799/7 "2023-12-17T12:28:42Z")

</div>

Hi, updating.  
You can add splashscreen with [Unreal Plugin Language | Unreal Engine 4.27 Documentation](https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Mobile/UnrealPluginLanguage/).  
This extension enables us to customize the AndroidManifest.xml. Go check the link.  
Also, I found the so useful plugin [Sovahero/PluginMobileNativeCode (github.com)](https://github.com/Sovahero/PluginMobileNativeCode) that you can display splash screen and even execute Java code with it. I strongly recommend you use it🤞.

---

<div class="post-metadata">

**Author:** ![ZemmaiSamurai\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZemmaiSamurai\_1](https://forums.unrealengine.com/u/ZemmaiSamurai_1)\
**Post date:** [December 17, 2023, 12:35pm UTC](https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799/8 "2023-12-17T12:35:43Z")

</div>

Specifically, Intermediate/Build/Android/.gradle, I remember.  
You may have to delete this directory when compiling, so it is easy to do so in build.cs. (it disturbed compiling everytime in my case)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [January 16, 2024, 12:36pm UTC](https://forums.unrealengine.com/t/how-can-i-add-android-exported-attribute-to-splashactivity-part-in-androidmanifest-xml-with-an-api-31-project/635799/9 "2024-01-16T12:36:36Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
