keywords: UE4, Android, Packaging, Building

Common Cases

How to include engine third party in game

Add third party name (the directory name in Engine\Source\ThirdParty\ or in Engine\Source\Runtime\) in PublicDependencyModuleNames in Build.cs.

e.g.

PublicDependencyModuleNames.AddRange(
new string[]
    {
        "HTTP",
        "OpenSSL",
        "libcurl",
        "libWebSockets",
        "Foliage"
    }
);

HTTP was in Engine\Source\Runtime\Online\HTTP, and Foliage was in Engine\Source\Runtime\Foliage. If there’s a .Build.cs under a directory, that means we can add the name of directory into PublicDependencyModuleNames.

If want to add WebSocket in your project, you can add either WebSockets or libWebSockets in PublicDependencyModuleNames, because there’re two libraries of WebSocket, which are in Engine\Source\Runtime\Online\WebSockets and Engine\Source\ThirdParty\libWebSockets, in engine.

Android Package

BUILD FAILED:gradle\rungradle.bat” :app:assembleDebug

Android APK send to device failed in v4.18, error log:

ExceptionUtils.PrintExceptionInfo: ERROR: cmd.exe failed with args /c "D:\Stage - kornelis\ARcore\HelloARSample 4.18\Intermediate/Android/APK\gradle\rungradle.bat" :app:assembleDebug ExceptionUtils.PrintExceptionInfo: 

Solution:
1,Double click NVPACK/android-sdk-windows/tools/android.bat;
2,Click “Deselect All”;
3,Check Extras / Android Support Repository, then click Install;

How to enable OpenGL ES3.1 and Vulkan

Project Settings -》 Platforms -》 Android -》 Build -》 Support OpenGL ES3.1, By default is using OpenGL ES2.

How to Hide Android App Soft Keys(Home key and Return key, Virtual Keys)

Project Settings -》 Android -》 Platforms -》 Enable FullScreen Immersive on KitKat and above devices

How to change application name of APK

Project Settings -> Platforms -> Android -> Application Display Name(app_name)

Linux Package

Cross-Compiling for Linux

Cross-Compiling for Linux
https://docs.unrealengine.com/en-US/Platforms/Linux/GettingStarted/index.html

Building Unreal Engine Game Client and Dedicated Server on Linux
https://gist.github.com/zhiguangwang/42b0584ae689f0f8711790e4c05d76f1

Building and Hosting an Unreal Engine Dedicated Server with AWS and Docker
https://medium.com/swlh/building-and-hosting-an-unreal-engine-dedicated-server-with-aws-and-docker-75317780c567


岂能尽如人意,但求无愧我心。──丁聪