Android building in Linux (somewhat of a tutorial)

Ive been working on this and i thought i would share what ive got so far,

install current jdk for your distro, open jdk seems to work fine.

get the tadp package for you distro from nvidia. eg: “tadp-4.0r1-linux-x64.run”

it will make life a wee bit easier on you, it even updates your ~/.bashrc for you.
install, defaults should be fine.

next a logout and in may be needed, not to sure about that, but it couldnt hurt.

now we have to do a little editing to some files.
I edited my Engine/Build/BatchFiles/Linux/Build.sh

adding the Path exports for the android sdk eg:


#!/bin/sh

# This script gets can be used to build clean individual projects using UnrealBuildTool

set -e

export PATH=$PATH:"/home/angelo/NVPACK/android-sdk-linux/tools"
export ANDROID_HOME="/home/angelo/NVPACK/android-sdk-linux"

export PATH=$PATH:"/home/angelo/NVPACK/android-sdk-linux/platform-tools"

export PATH=$PATH:"/home/angelo/NVPACK/android-sdk-linux/build-tools"

export PATH=$PATH:"/home/angelo/NVPACK/android-sdk-linux/extras/android/support-tools"

export PATH=$PATH:"/home/angelo/NVPACK/android-ndk-r10d"

export NDK_ROOT="/home/angelo/NVPACK/android-ndk-r10d"
export NDKROOT="/home/angelo/NVPACK/android-ndk-r10d"
export NVPACK_NDK_VERSION="android-ndk-r10d"
export NDK_STANDALONE_46_ANDROID9_32="/home/angelo/NVPACK/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/gen_standalone/linux-x86_64"
export NDK_STANDALONE_46_ANDROID9_64="/home/angelo/NVPACK/android-ndk-r10d/toolchains/aarch64-linux-android-4.9/gen_standalone/linux-x86_64"

export PATH=$PATH:"/home/angelo/NVPACK/apache-ant-1.8.2/bin"
export ANT_HOME="/home/angelo/NVPACK/apache-ant-1.8.2"

export PATH=$PATH:"/home/angelo/NVPACK/gradle-2.2.1/bin"
export GRADLE_HOME="/home/angelo/NVPACK/gradle-2.2.1"
export CUDA_TOOLKIT_ROOT_6_5="/home/angelo/NVPACK/cuda-6.5"

export PATH=$PATH:"/home/angelo/NVPACK/cuda-7.0/bin"
export CUDA_TOOLKIT_ROOT="/home/angelo/NVPACK/cuda-7.0"
export CUDA_TOOLKIT_ROOT_7_0="/home/angelo/NVPACK/cuda-7.0"

export NVPACK_ROOT="/home/angelo/NVPACK"

you may not need to do this.

in Engine/Source/Programs/UnrealBuildTool/Android/AndroidToolChain.cs
at line 226 after


string ArchitecturePathMac = @"prebuilt/darwin-x86_64";

add:


string ArchitecturePathLinux = @"prebuilt/linux-x86_64";

then a little further down find


			else if (Directory.Exists(Path.Combine(NDKPath, ArchitecturePathMac)))
			{
				Log.TraceVerbose("        Found Mac versions of toolchain");
				ArchitecturePath = ArchitecturePathMac;
				ExeExtension = "";
			}

and add


			else if (Directory.Exists(Path.Combine(NDKPath, ArchitecturePathLinux)))
			{
				Log.TraceVerbose("        Found Linux versions of toolchain");
				ArchitecturePath = ArchitecturePathLinux;
				ExeExtension = "";
			}

directly after.
this remedies being unable to find the android toolchain.

now, since linux is Very Case sensitive,
we need to edit 2 more files.
open Engine/Source/Runtime/Core/Private/Android/AndroidFile.cpp

and fix the 2 includes at the top.
they should be lower case like so…


#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>

next open Engine/Source/Runtime/Launch/Private/Android/AndroidJNI.cpp
and fix those as well:


#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>

dont forget to save.

as of this moment you also need to copy over
libvorbis.a
libvorbisenc.a
libvorbisfile.a
from Engine/Source/ThirdParty/Vorbis/libvorbis-1.3.2/lib/Android/
(there are 3 folders there, make sure you match the architecture you are building for)
to
~/NVPACK/android-ndk-r10d/platforms/android-19/+YOUR architecture+/usr/lib/
that will take care of missing libs.

now you can issue:
./Engine/Build/BatchFiles/Linux/Build.sh UE4Game Android Development
./Engine/Build/BatchFiles/Linux/Build.sh UE4Client Android Development
and they will build

I have yet to package and push it to my device, i will attempt that later this evening, but this is a big chunk of what was holding me back so far.

hopefully someone will find this useful, and i will post my findings, when i try to get it on my device.
angelo aka angjminer.

Hi angjminer,

Please do update when you’ve had a chance to package and let us know if it succeeds. Android dev for Linux is something that pops up from time to time, so thanks very much for outlining your process here.

I’ve been working on getting the editor portion working as well, had to get a couple of sdk’s beyond android, bit it is progressing fine. It shouldn’t be to long before I can package it up from the command line, and editor. Have a cooking issue to work out, but from what I am seeing editor wise, most of it is already there, just have to tweak it From the mac stuff. I’ll post more when I get further along.

atm via command line ive got a cook issue to figure out:


and in the editor, ive got device detection, and packaging(showing up) to figure out.
but project settings seem to be fine:

this is all from linux, i still have more editor work to do , but soon…

Hi angjminer,

thank you for delving into this … I just wanted to share my little findings, trying your changes and looking at your fork…
You can skip copying the vorbis libs by correcting the Paths in

Engine/Source/ThirdParty/Vorbis/Vorbis.Build.cs
Engine/Source/ThirdParty/Vorbis/VorbisFile.Build.cs

else if (Target.Platform == UnrealTargetPlatform.Android)
{
// filtered in toolchain
PublicLibraryPaths.Add(VorbisPath + “Lib/Android/ARMv7”);
PublicLibraryPaths.Add(VorbisPath + “Lib/Android/ARM64”);
PublicLibraryPaths.Add(VorbisPath + “Lib/Android/x86”);
PublicLibraryPaths.Add(VorbisPath + “Lib/Android/x64”);

		PublicAdditionalLibraries.Add("vorbisfile");
	}

Thank you again and good luck on this.
Kind regards

Thanks for this Angminer, has been a lot of help.

The Vorbis fix that worked for me (promoted 4.8 build as of this post) was similar to HatoriHanso’s post above. In the two files above, fix the path so that “Lib is lower case”:

else if (Target.Platform == UnrealTargetPlatform.Android)
{
// toolchain will filter
PublicLibraryPaths.Add(VorbisPath + “lib/Android/ARMv7”);
PublicLibraryPaths.Add(VorbisPath + “lib/Android/ARM64”);
PublicLibraryPaths.Add(VorbisPath + “lib/Android/x86”);
PublicLibraryPaths.Add(VorbisPath + “lib/Android/x64”);

                    PublicAdditionalLibraries.Add("vorbis");
            }

Hi angjminer!

Thanks a lot for sharing! I went into the same trouble than you about the cooking concern (project compile just fine.) with the same error


ShaderCompileWorker: ../../src/hlslcc_lib/OptValueNumbering.cpp:741: void SCFGCreator::LinkBasicBlocks(TBasicBlockList::iterator &): Assertion `0' failed.

How have you resolved this?

EDIT:
A quick’n’dirty walk around was to comment the assertion in code. Now projects just deploy like a charm from editor to device with the project launcher! :slight_smile:

Thx!

On 4.8.0-release I had to get the* libTextureConverter.so* from Adreno SDK to fix a dependency issue with the TextureFormatAndroid module.

UE4 version : 4.8.0-release
OS : Ubuntu 14.04

I have some missing libs on UE4 4.8.2 version.
Anyone have solved the issue?

user@agile:~/uengine4/UnrealEngine$ ./Engine/Build/BatchFiles/Linux/Build.sh UE4Game Android Deveuserment
Building UE4Game…
Using clang version ‘3.5.2’ (string), 3 (major), 5 (minor), 2 (patch)

Compiling Native code with NDK API ‘android-19’
Performing 1 actions (5 in parallel)
[1/1] clang++ UE4Game-armv7-es2.so
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lcxa_demangle
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -licudata
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -licuuc
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -licui18n
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -licule
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -liculx
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -licuio
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lfreetype2412
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lnvToolsExt
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lLowLevelPROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lLowLevelClothPROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lPhysX3PROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lPhysX3CharacterKinematicPROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lPhysX3ExtensionsPROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lPhysX3CommonPROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lPhysX3VehiclePROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lPxTaskPROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lPhysXVisualDebuggerSDKPROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lPhysXProfileSDKPROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lPvdRuntimePROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lSceneQueryPROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lSimulationControllerPROFILE
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lcurl
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lcrypto
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lssl
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lpng
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -logg
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lvorbis
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lvorbisfile
/home/user/NVPACK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9/…/…/…/…/arm-linux-androideabi/bin/ld: error: cannot find -lgpg

Hi.

I’m new to Unreal Engine 4 and I’m not an advanced Linux user. Recently I started to develop my own game with a goal to publish it through Google Play. The problem is that I still can’t understand how to make Unreal Editor to detect my android device, and why there is no Android option in my project settings (there are only Linux and iOS there).

Could you please explain, how exactly did you fix the Editor, so it began to detect Android devices and got Android option in project settings?

…Well, I decided to use Windows instead of Linux. That was the most easy way to solve the problem.

I’ve been reeling from this ugly discovery all day. I should have tested Android deployment right out of the starting gates.

I messed around with Angelo’s hacks, and made some progress, but this is way more work than I want to do in a fork.

I either set myself up with a computer running Windows, or I find a different game engine, because Unreal on Linux has hit the brick wall at the end of the ride, and it’s a dead end.

****. I’m very disappointed.

Unreal Engine 4 is an amazing tool. The further I proceed with my game development, the more I see how user friendly and powerful the engine is. I’m not new to game development itself, but I’m totally new to UE4 and individual game development. I’m not a programmer, I have limited art skills, but still able to develop my game thanks to the engine and its developers.

I believe switching to Windows and keep using UE4 is really good idea.

Android building in Linux

The Android build is routinely tested in house on recent versions of Ubuntu LTS (14.04), but most distributions should have the required build tools available. Reports of successes or failures on other distributions are welcome.

For Gingerbread (2.3.x) and newer versions, including the master branch, a 64-bit environment is required. Older versions can be compiled on 32-bit systems.
Software Testing Training in Chennai

Do you mean the Linux build? I have the Linux build working reasonably well on Ubuntu LTS 64-bit. It has glitches and bugs and crashes a lot, but I can deal with that. The problem is there is no ability to deploy to Android from here. That’s what this thread is about.

The reasonable solution to this problem is to switch to Windows. I haven’t gone there since Windows ME myself, and don’t plan to start today, so I have to find another way.

Well, the Unreal Engine 4 on GNU/Linux didn’t hit the brick wall, and there is no end. It is just not official really supported. Here for example for people interested in stuff I did already plus Android support too:

Here HTML, CEF, WebWidgets etc.

So nothing is really impossible. It is just that people ask, why should they support it on GNU/Linux. I know why and I think the GNUX (GNU/Linux) system is predestinated and really good for development.

Hi angjminer,
Could you tell me how you solved problem with cooking? I’ve done everything you said and whole android packaging process seemed to be done. But cooking stopped with error: no TP AndroidTargetPlatform! I suppose you have managed to cook project.
On windows I can see these lines while cooking:



Project.Cook: ********** COOK COMMAND STARTED **********
...
UE4Editor-Cmd: LogInit:Display: RandInit(585973854) SRandInit(585973877).
UE4Editor-Cmd: [2016.02.25-13.54.28:697]  0]LogShaderCompilers:Display: Using Local Shader Compiler.
UE4Editor-Cmd: [2016.02.25-13.54.44:815]  0]LogDerivedDataCache:Display: Max Cache Size: 512 MB
UE4Editor-Cmd: [2016.02.25-13.54.53:357]  0]LogDerivedDataCache:Display: Loaded Boot cache: ../../../../Arkanoid/DerivedDataCache/Boot.ddc
UE4Editor-Cmd: [2016.02.25-13.55.57:868]  0]LogTemp:Display: Loaded TP AllDesktopTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.57:874]  0]LogTemp:Display: Loaded TP WindowsClientTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.57:884]  0]LogTemp:Display: Loaded TP WindowsNoEditorTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.57:893]  0]LogTemp:Display: Loaded TP WindowsServerTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.57:903]  0]LogTemp:Display: Loaded TP WindowsTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.57:911]  0]LogTemp:Display: Loaded TP AndroidTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.57:921]  0]LogTemp:Display: Loaded TP Android_ASTCTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.57:924]  0]LogTemp:Display: Loaded TP Android_ATCTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.57:936]  0]LogTemp:Display: Loaded TP Android_DXTTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.57:951]  0]LogTemp:Display: Loaded TP Android_ETC1TargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.57:964]  0]LogTemp:Display: Loaded TP Android_ETC2TargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.58:041]  0]LogTemp:Display: Loaded TP Android_MultiTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.58:041]  0]LogTemp:Display: Loaded TP Android_PVRTCTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.58:043]  0]LogTemp:Display: Loaded TP HTML5TargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.58:278]  0]LogTemp:Display: Loaded TP IOSTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.58:283]  0]LogTemp:Display: Loaded TP TVOSTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.58:287]  0]LogTemp:Display: Loaded TP LinuxNoEditorTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.58:344]  0]LogTemp:Display: Loaded TP LinuxServerTargetPlatform
UE4Editor-Cmd: [2016.02.25-13.55.58:353]  0]LogTemp:Display: Loaded TP LinuxTargetPlatform


But on Linux (Ubuntu) I can see only this:



UE4Editor: [2016.02.25-19.36.33:858]  0]LogHAL: FLinuxPlatformProcess::CreateProc: spawned child 13248
UE4Editor: [2016.02.25-19.36.34:884]  0]LogTemp:Display: Loaded TP AllDesktopTargetPlatform
UE4Editor: [2016.02.25-19.36.34:884]  0]LogHAL: Child 13248 is no more running (zombie), Wait()ing immediately.
UE4Editor: [2016.02.25-19.36.34:884]  0]LogTemp:Display: Loaded TP AllDesktopTargetPlatform
UE4Editor: [2016.02.25-19.36.35:493]  0]LogTemp:Display: Loaded TP LinuxNoEditorTargetPlatform
UE4Editor: [2016.02.25-19.36.35:493]  0]LogTemp:Display: Loaded TP LinuxNoEditorTargetPlatform
UE4Editor: [2016.02.25-19.36.36:072]  0]LogTemp:Display: Loaded TP LinuxServerTargetPlatform
UE4Editor: [2016.02.25-19.36.36:072]  0]LogTemp:Display: Loaded TP LinuxServerTargetPlatform
UE4Editor: [2016.02.25-19.36.36:688]  0]LogTemp:Display: Loaded TP LinuxTargetPlatform
UE4Editor: [2016.02.25-19.36.36:688]  0]LogTemp:Display: Loaded TP LinuxTargetPlatform
UE4Editor: [2016.02.25-19.36.37:262]  0]LogTemp:Display: Failed to get target platform HTML5TargetPlatform
UE4Editor: [2016.02.25-19.36.37:262]  0]LogTemp:Display: Failed to get target platform HTML5TargetPlatform
UE4Editor: [2016.02.25-19.36.37:262]  0]LogTargetPlatformManager:Display: Building Assets For LinuxNoEditor


So, there is no AndroidTargetPlatform. As I said Unreal Engine tuned well. I had installed full NVPACK, Setup.sh script had downloaded dependencies for Android and build (compiling and linking using Android NDK) process finished.

Thank you.

p.s. I have UE4 4.11 builded from source. But I found out that the same problem takes place with 4.9 and 4.10 binaries.

The following worked for me to build android platform with Unreal Engine under Linux

  1. Build unreal from source on linux by following this instructions
    A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums

  2. Install CodeWorksforAndroid
    cd UnrealEngine/Engine/Extras/AndroidWorks/Linux/
    ./CodeWorksforAndroid-1R6u1-linux-x64.run

In installer install also the target Android API version

  1. Run again setup.sh with full sync and generate project files in UnrealEngine folder
    cd UnrealEngine
    ./Setup.sh --all
    ./GenerateProjectFiles.sh

  2. Run Unreal editor again
    ./Engine/Binaries/Linux/UE4Editor

I tried with unreal 19.1 and CodeWorks 1R6u1 and gradle fails:

UEDeployAndroid.MakeApk: ====4/24/2018 9:54:22 PM====PERFORMING FINAL APK PACKAGE OPERATION================================================
UEDeployAndroid.RunCommandLineProgramWithException: Fix gradlew permissions
UEDeployAndroid.RunCommandLineProgramWithException: Making .apk with Gradle...
ExceptionUtils.PrintExceptionInfo: ==============================================================================
ExceptionUtils.PrintExceptionInfo: ERROR: /bin/sh failed with args -c '"/home/kemuri/Development/data/zyrog/Intermediate/Android/APK/gradle/gradlew" :app:assembleDebug'
ExceptionUtils.PrintExceptionInfo:        (see /home/kemuri/Library/Logs/Unreal Engine/LocalBuildLogs/UAT_Log.txt for full exception trace)
ExceptionUtils.PrintExceptionInfo:
ExceptionUtils.PrintExceptionInfo: BuildException: /bin/sh failed with args -c '"/home/kemuri/Development/data/zyrog/Intermediate/Android/APK/gradle/gradlew" :app:assembleDebug'
ExceptionUtils.PrintExceptionInfo:   at UnrealBuildTool.UEDeployAndroid.RunCommandLineProgramWithException (System.String WorkingDirectory, System.String Command, System.String Params, System.String OverrideDesc, System.Boolean bUseShellExecute) [0x000c9] in <afe0495c1e3440508128c2c7887ee229>:0
ExceptionUtils.PrintExceptionInfo:   at UnrealBuildTool.UEDeployAndroid.MakeApk (UnrealBuildTool.AndroidToolChain ToolChain, System.String ProjectName, System.String ProjectDirectory, System.String OutputPath, System.String EngineDirectory, System.Boolean bForDistribution, System.String CookFlavor, System.Boolean bMakeSeparateApks, System.Boolean bIncrementalPackage, System.Boolean bDisallowPackagingDataInApk, System.Boolean bDisallowExternalFilesDir) [0x01b81] in <afe0495c1e3440508128c2c7887ee229>:0
ExceptionUtils.PrintExceptionInfo:   at UnrealBuildTool.UEDeployAndroid.PrepForUATPackageOrDeploy (Tools.DotNETCommon.FileReference ProjectFile, System.String ProjectName, Tools.DotNETCommon.DirectoryReference ProjectDirectory, System.String ExecutablePath, System.String EngineDirectory, System.Boolean bForDistribution, System.String CookFlavor, System.Boolean bIsDataDeploy) [0x00021] in <afe0495c1e3440508128c2c7887ee229>:0
ExceptionUtils.PrintExceptionInfo:   at AndroidPlatform.Deploy (AutomationTool.ProjectParams Params, DeploymentContext SC) [0x000fd] in <745245a867de44f5a119127fdf6c4002>:0
ExceptionUtils.PrintExceptionInfo:   at Project.Deploy (AutomationTool.ProjectParams Params) [0x00178] in <e7327205191547a1b6dbc389719f70b0>:0
ExceptionUtils.PrintExceptionInfo:   at BuildCookRun.DoBuildCookRun (AutomationTool.ProjectParams Params) [0x000a8] in <e7327205191547a1b6dbc389719f70b0>:0
ExceptionUtils.PrintExceptionInfo:   at BuildCookRun.ExecuteBuild () [0x00041] in <e7327205191547a1b6dbc389719f70b0>:0
ExceptionUtils.PrintExceptionInfo:   at AutomationTool.BuildCommand.Execute () [0x00001] in <7af898f801e5496dac231f6d6bb0159c>:0
ExceptionUtils.PrintExceptionInfo:   at AutomationTool.Automation.Execute (System.Collections.Generic.List`1[T] CommandsToExecute, System.Collections.Generic.Dictionary`2[TKey,TValue] Commands) [0x00076] in <7af898f801e5496dac231f6d6bb0159c>:0
ExceptionUtils.PrintExceptionInfo:   at AutomationTool.Automation.Process (System.String] Arguments) [0x002d1] in <7af898f801e5496dac231f6d6bb0159c>:0
ExceptionUtils.PrintExceptionInfo:   at AutomationTool.Program.MainProc (System.Object Param) [0x00001] in <ad8cee9163eb411bbcbf4b23d44f3315>:0
ExceptionUtils.PrintExceptionInfo:   at AutomationTool.InternalUtils.RunSingleInstance (System.Func`2[T,TResult] Main, System.Object Param) [0x000a3] in &lt;7af898f801e5496dac231f6d6bb0159c&gt;:0
ExceptionUtils.PrintExceptionInfo:   at AutomationTool.Program.Main () [0x00198] in &lt;ad8cee9163eb411bbcbf4b23d44f3315&gt;:0
ExceptionUtils.PrintExceptionInfo: ==============================================================================
Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)

any1 has a clue?

which one is the best to choose for development purpose either Linux or windows, in Linux since its closed operating system the security will be good from malware but in windows, it is easy to access all options very quickly and friendly way, I’m confused to chooses in these two?:slight_smile: