[Fixed] Unreal Engine 5.2 Android package failed: android-32 30.0.3 3.10.2.4988404 25.1.8937393 -noninteractive failed – Android

by
Ali Hasan
.net-sdk android packaging unreal-engine5

Quick Fix: Replace "SetupAndroid.bat" with its version number, for instance: "D:\EpicGames\UE_5.2\Engine\Extras\Android\SetupAndroid.bat" Replace "5.2" with your current Unreal Engine version number.

The Problem:

When trying to package an Android project in Unreal Engine 5.2, the user encounters the error: "Command E:\Program Files\Epic Games\UE_5.2\Engine\Extras\Android\SetupAndroid.bat android-32 30.0.3 3.10.2.4988404 25.1.8937393 -noninteractive failed [Exit code 4, working dir = E:\Program Files\Epic Games\UE_5.2\Engine\Extras\Android]". The user has followed multiple tutorials and setup guides, including those from Alex Pearce and Nils Gallist, but the error persists. Additionally, there is confusion regarding the required Android SDK and NDK versions, as Unreal Engine documentation states that NDK should be version r25b, while the error message mentions a failed attempt to install Android SDK r25b.

The Solutions:

Solution 1: Overriding the SetupAndroid.bat File

In this approach, we modify the SetupAndroid.bat file that is responsible for setting up the Android SDK and NDK for packaging. This modification overrides the default behavior and resolves the issue at hand.

Steps:

1. Locate the SetupAndroid.bat File:

  • Navigate to the following directory:
        <Installation Directory>\UE_5.2\Engine\Extras\Android

2. Replace SetupAndroid.bat with 5.1:

  • Locate the SetupAndroid.bat file and rename it to SetupAndroid.bat.old.
  • Create a new text file and name it SetupAndroid.bat.
  • Open the newly created SetupAndroid.bat file in a text editor.

3. Paste the Following Content:

Copy and paste the following content into the SetupAndroid.bat file, replacing the existing content:

call "%~dp0\SetupAndroid_5.1.bat" %*

4. Save the Changes:

  • Save the modified SetupAndroid.bat file.

5. Attempt Packaging Again:

  • Retry the packaging process for your Android project. The error should be resolved, and the packaging should proceed successfully.

Solution 2: Use the Correct SDK and NDK Versions and Edit SetupAndroid.bat File

To fix the “Unreal Engine 5.2 Android package failed: android-32 30.0.3 3.10.2.4988404 25.1.8937393 -noninteractive failed” error, follow these steps:

Step 1: Set Up Android SDK, NDK, and Unreal Engine:

  1. Ensure that you’re using Android Studio version 4.0 and not the latest version.
  2. Download and install the required Android SDK and NDK versions specified in Unreal Engine’s official documentation.
  3. In Unreal Editor, set the Minimum SDK Version to 30 and the Target SDK Version to 33 under Project Settings > Android.
  4. Set the SDK API Level and NDK API Level to android-29 in Project Settings > Android SDK.

Step 2: Edit SetupAndroid.bat File:

  1. Locate the SetupAndroid.bat file typically found in "LocalDisk/Program Files/Epic Games/UE_5.2/Engine/Extras/Android".
  2. Open the file in a text editor such as Notepad.
  3. Search for "SDKMANAGER" and update the code to match this structure:
set SDKMANAGER=%STUDIO_SDK_PATH%\cmdline-tools\latest\bin\sdkmanager.bat
IF EXIST "%SDKMANAGER%" (
	echo Using sdkmanager: %SDKMANAGER%
) ELSE (
	set SDKMANAGER=%STUDIO_SDK_PATH%\cmdline-tools\latest\bin\sdkmanager.bat
	IF EXIST "!SDKMANAGER!" (
		echo Using sdkmanager: !SDKMANAGER!
	) ELSE (
		echo Unable to locate sdkmanager.bat. Did you run Android Studio and install cmdline-tools after installing?
		%PAUSE%
		exit /b 3
	)
)

Step 3: Rename Latest Android Command Line Tools Folder:

  1. Navigate to "LocalDisk/Users/UserName/AppData/Local/Android/SDK/cmdline-tools".
  2. Identify the folder with the highest version number (e.g., 8.0).
  3. Rename the folder from its version number to "latest".

Step 4: Retry Building in Unreal Editor:

  1. Re-open the Unreal Editor project.
  2. Attempt to build the Android package again.

If these steps don’t resolve the issue, try using different versions of the Android SDK Command-line Tools and repeating the process. Please refer to the official Unreal Engine documentation for specific details regarding SDK and NDK requirements for your Unreal Engine version.

Q&A

What is the error that prevents Unreal Engine from packaging the Android game?

The packaging fails due to an issue with the installation of the Android SDK’s.

What changes were made to the SetupAndroid.bat file?

The SDKMANAGER section of the SetupAndroid.bat file was modified.

What is the version of the Android SDK Command-line Tools that worked for the user?

Version 8.0 was used successfully.

Video Explanation:

The following video, titled "Unreal Engine - Set up SDK, NDK and JDK for VR and other ...", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

This video provides further insights and detailed explanations related to the content discussed in the article.