# Attempting to Pack a UE4.27.2 build to test on Android 14 - PackagingResults: Error: Launch failed! Unknown Error

**URL:** <https://forums.unrealengine.com/t/attempting-to-pack-a-ue4-27-2-build-to-test-on-android-14-packagingresults-error-launch-failed-unknown-error/1981492>\
**Category:** Mobile\
**Tags:** unreal-engine, question\
**Created:** [August 18, 2024, 1:35pm UTC](https://forums.unrealengine.com/t/attempting-to-pack-a-ue4-27-2-build-to-test-on-android-14-packagingresults-error-launch-failed-unknown-error/1981492 "2024-08-18T13:35:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BetaUltra](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BetaUltra](https://forums.unrealengine.com/u/BetaUltra)\
**Post date:** [August 18, 2024, 1:35pm UTC](https://forums.unrealengine.com/t/attempting-to-pack-a-ue4-27-2-build-to-test-on-android-14-packagingresults-error-launch-failed-unknown-error/1981492/1 "2024-08-18T13:35:15Z")

</div>

I’m attempting to build my first mobile game project, and have run into a few hiccups in the setup process:  
I am building a mobile game on UE 4.27.2, and the primary device I am looking to initially test on is a Galaxy S24 Ultra, running Android 14.  
Setting up Android’s SDK tools, I have the following versions installed and used by the project:  
Android SDK - API Level 34  
Android NDK - API Level 21  
I also have Android Studio Version 4.0 installed with both Android SDK Build 34.0.0, and 30.0.3 installed.

Regardless of what combination I try, or what solution I find online to the issues I’m having, I always end up with the same error:

```auto
LogPlayLevel: Execution failed for task ':app:processDebugResources'.
LogPlayLevel: > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
LogPlayLevel: > AAPT2 aapt2-4.0.0-6051327-windows Daemon #0: Unexpected error during link, attempting to stop daemon.
LogPlayLevel: This should not happen under normal circumstances, please file an issue if it does.
LogPlayLevel: * Try:
LogPlayLevel: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
LogPlayLevel: * Get more help at https://help.gradle.org
LogPlayLevel: BUILD FAILED in 8s
LogPlayLevel: 23 actionable tasks: 1 executed, 22 up-to-date
LogPlayLevel: Error: ERROR: cmd.exe failed with args /c "Z:\[filepath]\Intermediate\Android\arm64\gradle\rungradle.bat" :app:assembleDebug
LogPlayLevel: (see C:\[filepath]\AppData\Roaming\Unreal Engine\AutomationTool\Logs\Z+Epic+Games+UE_4.27\Log.txt for full exception trace)
LogPlayLevel: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 12.013890
LogPlayLevel: BUILD FAILED
PackagingResults: Error: Launch failed! Unknown Error

```

---

<div class="post-metadata">

**Author:** ![drpsyko](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@drpsyko](https://forums.unrealengine.com/u/drpsyko)\
**Post date:** [August 19, 2024, 4:37am UTC](https://forums.unrealengine.com/t/attempting-to-pack-a-ue4-27-2-build-to-test-on-android-14-packagingresults-error-launch-failed-unknown-error/1981492/2 "2024-08-19T04:37:20Z")

</div>

Android 14 (SDK 34) builds are required to specify a flag to indicate whether the receiver should be exported to all other apps on the device: either `RECEIVER_EXPORTED` or `RECEIVER_NOT_EXPORTED`, respectively. This changes, however, require minimum NDK r25, which aren’t currently supported in 4.27 nor 4.27Plus. A workaround is to define the flag literal value in the `Engine/Build/Android/Java/src/com/epicgames/ue4/GameActivity.java.template:532`:

```diff
+	private static int RECEIVER_EXPORTED = 2;
	@Override
	public void onStart()
	{
		super.onStart();
		
		if (!BuildConfiguration.equals("Shipping"))
		{
			// Create console command broadcast listener
			Log.debug( "Creating console command broadcast listener");
			consoleCmdReceiver = new ConsoleCmdReceiver(this);
- registerReceiver(consoleCmdReceiver, new IntentFilter(Intent.ACTION_RUN));
+ registerReceiver(consoleCmdReceiver, new IntentFilter(Intent.ACTION_RUN), RECEIVER_EXPORTED);
		}
//$${gameActivityOnStartAdditions}$$
		Log.debug("==================================> Inside onStart function in GameActivity");
	}

```

Another important thing to do is to set these parameters in your project’s `Config/DefaultEngine.ini`:

```ini
[/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]
TargetSDKVersion=34
bBuildForArm64=True
bBuildForArmV7=False
SDKAPILevelOverride=matchndk
NDKAPILevelOverride=latest
+ExtraActivityNodeTags=android:exported="true"
bShowLaunchImage=False
bSupportAdMob=False
bPackageDataInsideApk=True

```

Use NDK r23 (23.0.7599858) and JDK 11 in the SDK setting.

---

<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:** [September 18, 2024, 4:38am UTC](https://forums.unrealengine.com/t/attempting-to-pack-a-ue4-27-2-build-to-test-on-android-14-packagingresults-error-launch-failed-unknown-error/1981492/3 "2024-09-18T04:38:14Z")

</div>

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