[Solution] How to setup to build game for Android!!!

Hello everyone, we must have had times when it was very difficult to fully install the necessary things for Unreal Engine to be able to build apk files for the Android operating system. Here are some experiences I have, I am using UE 5.1 on Windows 10 OS.

  1. Download and install Android Studio here Download Android Studio & App Tools - Android Developers
    1.1 After successful download, install Android Studio like other application programs.
    1.2 After Android Studio has finished downloading the necessary components, open Android Studio and click More Actions then select SDK Manager.


    1.3 In SDK Tools tab, check components are marked in picture.

    Notice: Maybe your Android SDK Location is difference. My C drive was almost out of space, so I installed Android Studio and Android SDK to another drive. If you install Android Studio without customizing the path, your Android SDK path will be
    C:\Users\{YourComputerName}\AppData\Local\Android\Sdk | We need this path later.
    1.4 Check Show Package Details(1), then open Android SDK Command-line Tools (latest)(2), uncheck Android SDK Command-line Tools (latest)(3), check Android SDK Command-line Tools Version 8.0(4), then click OK(5), confirm change, wait for Android Studio to download and install all components we need, after that we finished Android Studio part.

  2. Download JDK 8 in this link Java Archive Downloads - Java SE 8
    2.1 Scroll down, choose the version that suits you, here I choose Windows x64. Then download, you need an oracle account to download this file


    After successful download, install JDK like other application programs
    2.2 Find Edit the system environment variables then open it

    then open Environment Variables…
    00
    2.3 Click New…

    In Variable Name, enter JAVA_HOME (1), Click Browse Directory… (2), find the path to the JDK directory, it should be C:\Program Files\Java\jdk1.8.0_202 (3), click OK (4)
    07
    In System variables, select Path (1), click Edit… (2)

    Click New (1), type %JAVA_HOME%\bin (2), click OK (3)

    Click OK, we done here

  3. Find SetupAndroid.bat | In my case, I installed unreal engine in another drive, so my path is D:\Epic Games\UE_5.1\Engine\Extras\Android | Right-click SetupAndroid.bat (1) and select Edit (2)


    Change the path to your Android SDK, as I said above if during Android Studio installation you did not change any path, then your path should be
    C:\Users\{YourComputerName}\AppData\Local\Android\Sdk

    Change the path to your sdkmanager.bat

    Save your SetupAndroid.bat, close text editor, then run SetupAndroid.bat | After SetupAndroid.bat finished setup, close it.

  4. Open your Unreal Engine project, go to Project Settings scroll down then select Android SDK locate Android SDK path, Java path

Above is what i did to build the apk file for Android. Hope you can complete this process

2 Likes