x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Build UE 4.7.3 with Android support

Hi, I'm trying to build the UE Editor on mac with Android support, but setup.command is not detecting the android SDK or NDK:

    Checking dependencies (excluding Win32, Win64, HTML5, Android)...

I've installed the Android SDK and NDK without using TAPD because I'm already regularly developing for Android. Please note that with the binary distribution of UE I can properly package my projects for Android.

This is my .bash_profile, what am I missing?

 export PATH=$PATH:/Users/xxx/NVPACK/apache-ant-1.8.2/bin
 export ANT_HOME=/Users/xxx/NVPACK/apache-ant-1.8.2
 export NVPACK_ROOT="/Users/xxx/NVPACK"
 export NDK_ROOT=/Developer/Android/android-ndk-r10d
 export ANDROID_NDK_ROOT=/Developer/Android/android-ndk-r10d
 export ANDROID_SDK_ROOT=/Developer/Android/sdk
 export PATH=$PATH:ANDROID_NDK_ROOT=/Developer/Android/android-ndk-r10d
Product Version: Not Selected
Tags:
more ▼

asked Mar 19 '15 at 01:17 AM in Installation & Setup

avatar image

devel.bmad
439 43 49 65

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Ok, solved, the variables to include in .bash_profile are named as follow:

 export PATH=$PATH:/Developer/Android/android-ndk-r10d
 export NDK_ROOT=/Developer/Android/android-ndk-r10d
 export NDKROOT=/Developer/Android/android-ndk-r10d

Actually this was not enough, the solution is down in the thread and involves building manually the android files (thank you Michael and Josh!)

 cd "/Users/xxx/Documents/Unreal Projects/UnrealEngine"
 ./Engine/Build/BatchFiles/Mac/Build.sh UE4Game Android Development
 ./Engine/Build/BatchFiles/Mac/Build.sh UE4Client Android Development
more ▼

answered Mar 19 '15 at 01:47 AM

avatar image

devel.bmad
439 43 49 65

avatar image devel.bmad Mar 19 '15 at 04:16 PM

Ok, not quite yet. With the aforementioned env variables I get the message saying that is checking dependencies correct, but after compiling the UE4Editor I can't see any Android target. So, when I try to deploy on android devices, I get the following error:

====03/19/2015 17:01:01====PREPARING NATIVE CODE================================================================= LogPlayLevel: BuildCommand.Execute: ERROR: BUILD FAILED LogPlayLevel: Program.Main: ERROR: AutomationTool terminated with exception: LogPlayLevel: Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: Can't make an APK without the compiled .so [/Users/xxx/Documents/Unreal Projects/UnrealEngine/Engine/Binaries/Android/UE4Game-armv7-es2.so] LogPlayLevel: Stacktrace: at UnrealBuildTool.Android.UEDeployAndroid.MakeApk (System.String ProjectName, System.String ProjectDirectory, System.String OutputPath, System.String EngineDirectory, Boolean bForDistribution, System.String CookFlavor, Boolean bMakeSeparateApks, Boolean bIncrementalPackage, Boolean bDisallowPackagingDataInApk) [0x00000] in :0 LogPlayLevel: at UnrealBuildTool.Android.UEDeployAndroid.PrepForUATPackageOrDeploy

...or an Alert saying that the UE4Game is missing when packaging. Is there a log when running setup.command to check what has been configured or shall I rebuild the whole editor at any attempt?

avatar image ZeroEightSix STAFF Mar 19 '15 at 05:00 PM

We use three variables: ANDROID_HOME, NDKROOT and ANT_HOME (plus JAVA_HOME, but only on Windows)

ANDROID_HOME should most likely be the same as your ANDROID_SDK_ROOT. Installed with TADP, the folder is called android-sdk-macosx and here's how it looks:

alt text

avatar image devel.bmad Mar 19 '15 at 05:17 PM

These variables are correctly set now (using TADP), but still I don't have any Android target platform. Any other check I can do? tools that should be on the path? is there a log of what's missing to enable android?

 export PATH=$PATH:/Users/xxx/NVPACK/apache-ant-1.8.2/bin
 export ANT_HOME=/Users/xxx/NVPACK/apache-ant-1.8.2
 export NVPACK_ROOT="/Users/xxx/NVPACK"
 #export ANDROID_HOME=/Developer/Android/sdk
 #export PATH=$PATH:/Developer/Android/sdk/platform-tools/
 export PATH=$PATH:/Developer/Android/android-ndk-r10d
 export NDK_ROOT=/Developer/Android/android-ndk-r10d
 export NDKROOT=/Developer/Android/android-ndk-r10d
 export NVPACK_NDK_VERSION=android-ndk-r10d
 export PATH=$PATH:/Users/xxx/NVPACK/android-sdk-macosx/tools
 export ANDROID_HOME=/Users/xxx/NVPACK/android-sdk-macosx
 export PATH=$PATH:/Users/xxx/NVPACK/android-sdk-macosx/platform-tools
 export PATH=$PATH:/Users/xxx/NVPACK/android-sdk-macosx/build-tools
 export PATH=$PATH:/Users/xxx/NVPACK/android-sdk-macosx/extras/android/support-tools


avatar image devel.bmad Mar 19 '15 at 06:41 PM

Just to double check, if everything was ok should I see "UE4Game - Android" among these options? How can I debug this problem?

alt text

avatar image ZeroEightSix STAFF Mar 19 '15 at 06:53 PM

Unfortunately, we don't have any support for building for Android from Xcode, so no, you shouldn't see UE4Game - Android in there. Currently you can only build Android binaries using command line tools (like Build.sh in Engine/Build/BatchFiles/Mac or from the UE4 editor).

avatar image devel.bmad Mar 19 '15 at 07:12 PM

Ok, that's not a problem. All I want is packaging from inside the UE4Editor, but I need to compile it from the github source. In the version I built there is no Android folder in the Engine/Binaries folder (though the environment variables should be correct now)

avatar image devel.bmad Mar 19 '15 at 07:45 PM

I mean, these are the files I find in the UE binary version which are missing from the one I compile from source:

alt text

avatar image ZeroEightSix STAFF Mar 19 '15 at 07:59 PM

You don't need these files in a build compiled from source. I believe that all necessary binaries should get build as part of packaging, but I'm not sure if that's also the case for blueprint-only projects. I'll check and get back to you.

avatar image devel.bmad Mar 19 '15 at 08:04 PM

Thank you. Launching on an android device displays the following error: Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: Can't make an APK without the compiled .so [/Users/xxx/Documents/Unreal Projects/UnrealEngine/Engine/Binaries/Android/UE4Game-armv7-es2.so]

So at least some of these files are probably necessary. On windows you have to compile selecting "Development Client" and "Android" build target, I would need to understand how to do that on mac:

https://answers.unrealengine.com/questions/138914/cant-make-an-apk-without-the-compiled-so-ue4game-a.html

avatar image ZeroEightSix STAFF Mar 19 '15 at 08:08 PM

You could try this:

cd "/Users/xxx/Documents/Unreal Projects/UnrealEngine"

./Engine/Build/BatchFiles/Mac/Build.sh UE4Game Android Development

./Engine/Build/BatchFiles/Mac/Build.sh UE4Client Android Development

avatar image devel.bmad Mar 19 '15 at 08:52 PM

Great, the compilation worked! Is the whole process documented somewhere?

There's still something missing though.. now in the Android folder I have the following files: cd Engine/Binaries/Android/ Lucas-MacBook-Pro:Android unstable$ ls UE4Client-armv7-es2.apk UE4Game-armv7-es2.apk UE4Client-armv7-es2.so UE4Game-armv7-es2.so

But for my project I need the OpenGL es31 version, I can I compile it?

LogPlayLevel: Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: Can't make an APK without the compiled .so [/Users/xxx/Documents/Unreal Projects/UnrealEngine/Engine/Binaries/Android/UE4Game-armv7-es31.so]

avatar image ZeroEightSix STAFF Mar 19 '15 at 08:57 PM

I'm glad it worked. I don't know if this is documented nor how to force building ES31 binaries, but I'll make sure someone who knows answers you.

avatar image joshbadams STAFF Mar 19 '15 at 09:04 PM

If you are using a Content Only project, it turns out that there's not a "nice" way to compile ES31. The way to do it is to manually open Config/BaseEngine.ini, and set bBuildForES31 to true, then build UE4Game for Android.

Note that ES31 is actually ES31 + AEP, so your device needs Android Extension Pack support, and this is pretty early. Not many devices with AEP have been tested, and it actually will only cook DXT textures when you package for the ES31+AEP target.

In 4.8, ES31+AEP is no longer a Target Platform, it is driven solely by the checkbox, and will Just Work (TM). Also, with a content only project, it will recompile the executable with ES31 support (into your project's directory).

Josh

avatar image devel.bmad Mar 19 '15 at 09:15 PM

Ok, great, good to know! Thank you both, you have been very helpful :-)

avatar image Sir Quizalot Apr 21 '15 at 06:02 PM

How do you have access to ./Engine/Build/BatchFiles/Mac/Build.sh UE4Game Android Development at cd "/Users/xxx/Documents/Unreal Projects/UnrealEngine"

Or rather what are the perquisites to do this? Do we need anything not specifically mentioned?

avatar image devel.bmad Apr 21 '15 at 10:23 PM

"./Engine/Build/BatchFiles/Mac/Build.sh" is a script, if you downloaded the source code of the engine from github you can find it in the path above. The other path refers to the location of the source code three.

avatar image Sir Quizalot Apr 22 '15 at 02:11 PM

Would this be any different to for building on OUYA with mac.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question