ERROR: ndk-build failed [NDK_DEBUG=1]

Hi,

I was following the tutorial on cooking and deploying a sample project for Android. Everything worked nice first, but the next day I launched UE and tried to build the same project with the same settings and it failed leaving this log:

[2014.07.23-01.55.43:949][ 58]LogPlayLevel:Display: It seems that there are sub-projects. If you want to update them
[2014.07.23-01.56.02:099][113]LogPlayLevel:Display: please use the --subprojects parameter.
[2014.07.23-01.56.13:416][678]LogPlayLevel:Display: Running: C:\NVPACK\android-ndk-r9c/ndk-build.cmd NDK_DEBUG=1
[2014.07.23-01.56.13:416][678]LogPlayLevel:Display: BuildCommand.Execute: ERROR: BUILD FAILED
[2014.07.23-01.56.13:440][679]LogPlayLevel:Display: Program.Main: ERROR: AutomationTool terminated with exception:
[2014.07.23-01.56.13:440][679]LogPlayLevel:Display: Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: ndk-build failed [NDK_DEBUG=1]
[2014.07.23-01.56.13:440][679]LogPlayLevel:Display: Stacktrace:    bei UnrealBuildTool.Android.UEDeployAndroid.MakeAPK(String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor)
[2014.07.23-01.56.13:440][679]LogPlayLevel:Display:    bei UnrealBuildTool.Android.UEDeployAndroid.PrepForUATPackageOrDeploy(String ProjectName, String ProjectDirectory, String ExecutablePath, String EngineDirectory, Boolean bForDistribution, String CookFlavor)
[2014.07.23-01.56.13:440][679]LogPlayLevel:Display:    bei AndroidPlatform.Deploy(ProjectParams Params, DeploymentContext SC)
[2014.07.23-01.56.13:440][679]LogPlayLevel:Display:    bei Project.Deploy(ProjectParams Params)
[2014.07.23-01.56.13:440][679]LogPlayLevel:Display:    bei BuildCookRun.DoBuildCookRun(ProjectParams Params)
[2014.07.23-01.56.13:440][679]LogPlayLevel:Display:    bei BuildCommand.Execute()
[2014.07.23-01.56.13:441][679]LogPlayLevel:Display:    bei AutomationTool.Automation.Execute(List`1 CommandsToExecute, CaselessDictionary`1 Commands)
[2014.07.23-01.56.13:441][679]LogPlayLevel:Display:    bei AutomationTool.Automation.Process(String[] CommandLine)
[2014.07.23-01.56.13:441][679]LogPlayLevel:Display:    bei AutomationTool.Program.MainProc(Object Param)
[2014.07.23-01.56.13:441][679]LogPlayLevel:Display:    bei AutomationTool.InternalUtils.RunSingleInstance(MainProc Main, Object Param)
[2014.07.23-01.56.13:441][679]LogPlayLevel:Display:    bei AutomationTool.Program.Main()
[2014.07.23-01.56.13:441][679]LogPlayLevel:Display: Program.Main: ERROR: ERROR: ndk-build failed [NDK_DEBUG=1]
[2014.07.23-01.56.13:441][679]LogPlayLevel:Display: ProcessManager.KillAll: Trying to kill 0 spawned processes.
[2014.07.23-01.56.13:441][679]LogPlayLevel:Display: Program.Main: AutomationTool exiting with ExitCode=1
[2014.07.23-01.56.13:441][679]LogPlayLevel:Display: Domain_ProcessExit
[2014.07.23-01.56.13:469][680]LogPlayLevel:Display: ProcessManager.KillAll: Trying to kill 0 spawned processes.
[2014.07.23-01.56.13:469][680]LogPlayLevel:Display: copying UAT log files...
[2014.07.23-01.56.13:469][680]LogPlayLevel:Display: RunUAT.bat ERROR: AutomationTool was unable to run successfully.
[2014.07.23-01.56.13:490][681]LogPlayLevel:Display: BUILD FAILED

EDIT: Here is the full log.

Installed TADP, running UE 4.3.

Any idea why this is happening?

UPDATE: Removing the contents of the “Intermediate” folder fixes the bug. Can’t reproduce the error yet.

Usually the real error is above all that output in the log.

AutomationTool crashed

Added the log file to the OP. Can’t see anything suspicious.

I am getting the same error.
What I noticed in the log posted here and my own log is something strange about the path of ndk-build.cmd:

Running: C:NVPACKandroid-ndk-r9c/ndk-build.cmd NDK_DEBUG=1
Running: C:\Program Files\Android NDK\android-ndk-r10b/ndk-build.cmd NDK_DEBUG=1

So… Do you notice the forward slash “/”, while it should be a backslash? It’s using a Unix path separator on Windows. Also, there is no separator after “C:”. Could this be a problem?..

Update:

I changed the NDKROOT environment variable by just adding a backslash at the end, and check out how this affected the log. It seems the way the path is handled needs to be fixed. Even if this is not the reason for the failed build.

Running: C:\Program Files\Android NDK\android-ndk-r10b\/ndk-build.cmd NDK_DEBUG=1

I just downloaded and setup everything according to the guide, all up to date. Using:
Nexus 4 (Android 4.4),
UE4 4.4.3,
Windows 7 x64,
Android SDK x32 rev. 23.0.2 / 20,
JDK x64,
Android NDK r10b (x64 for windows, x32 for output).
I tried ATC and ETC1 texture compression.

I am building the Sun Temple Mobile project.

I did not use the automated TADP to install all the SDK’s etc. I did it manually and set all environment variables. (However I believe this has nothing to do with the problem). I have followed all steps from the guides (https://docs.unrealengine.com/latest/INT/Platforms/Android/index.html)

Log:

LogPlayLevel:Display: Running: C:\Program Files\Android NDK\android-ndk-r10b/ndk-build.cmd NDK_DEBUG=1
LogPlayLevel:Display: BuildCommand.Execute: ERROR: BUILD FAILED
LogPlayLevel:Display: Program.Main: ERROR: AutomationTool terminated with exception:
LogPlayLevel:Display: Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: ndk-build failed [NDK_DEBUG=1]
LogPlayLevel:Display: Stacktrace:    at UnrealBuildTool.Android.UEDeployAndroid.MakeAPK(String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor)

(…)

Happened to me too. Removing the contents didn’t work. UE4.5 on Nexus5.

I had the same problem on
UE4.5,Nexus 5,USB debugging and all the stuff were fine (Used them thousand times in eclipse).,The phone was on PTP.
First I had some [Mobile/Tablet] in the default folder [C:\Users\Documents\Unreal Projects.…] that I had created BEFORE installing tadp. After installing tadp I create a [Mobile/Tablet] project [C:\Users\Documents] some place else. I did get the above error. then I did a silly thing and BAM it woked:

  1. I closed the engine
  2. Restarted the system [to get rid of any possible background processes]
  3. Deleted all the [Mobile/Tablet] projects I had in the default folder [C:\Users\Documents\Unreal Projects.…]
  4. Deleted the [Mobile/Tablet] project I had in the documents folder
  5. Created a new [Mobile/Tablet] project in the default folder.
  6. Lunched for nexus 5
    and it suddenly got passed the [LogPlayLevel:Display: BuildCommand.Execute: ERROR: BUILD FAILED] barrier and I could see the game running on my phone. I’m sharing the log. hope it helps
    link text

Guys I need your help please I just created a second first person project and now I get this error when deploying on android , I have attached my log file below thank; I tried the solutions above with not luck :frowning:

Preparing native code for debugging…
LogPlayLevel: ERROR: C:/NVPACK/android-ndk-r12b/ndk-build.cmd failed with args APP_ABI="armeabi-v7a " NDK_DEBUG=1
LogPlayLevel: (see C:\Users\pirat\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.18\UAT_Log.txt for full exception trace)
LogPlayLevel: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 30.275367
LogPlayLevel: BUILD FAILED
PackagingResults: Error: Launch failed! Unknown Error
link text