# ERROR: ndk-build failed \[NDK\_DEBUG=1\]

**URL:** <https://forums.unrealengine.com/t/error-ndk-build-failed-ndk-debug-1/289056>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** ndk, build, unreal-engine, Android, bug-report, question\
**Created:** [July 23, 2014, 4:26pm UTC](https://forums.unrealengine.com/t/error-ndk-build-failed-ndk-debug-1/289056 "2014-07-23T16:26:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SONB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SONB](https://forums.unrealengine.com/u/SONB)\
**Post date:** [July 23, 2014, 4:26pm UTC](https://forums.unrealengine.com/t/error-ndk-build-failed-ndk-debug-1/289056/1 "2014-07-23T16:26:17Z")

</div>

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](https://drive.google.com/file/d/0B80rMWHVTvKcVWNjQVh3MGhkMVE/edit?usp=sharing).

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.

---

<div class="post-metadata">

**Author:** ![GrafikRobot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrafikRobot](https://forums.unrealengine.com/u/GrafikRobot)\
**Post date:** [July 23, 2014, 4:32pm UTC](https://forums.unrealengine.com/t/error-ndk-build-failed-ndk-debug-1/289056/2 "2014-07-23T16:32:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [July 23, 2014, 5:12pm UTC](https://forums.unrealengine.com/t/error-ndk-build-failed-ndk-debug-1/289056/3 "2014-07-23T17:12:04Z")

</div>

AutomationTool crashed

---

<div class="post-metadata">

**Author:** ![SONB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SONB](https://forums.unrealengine.com/u/SONB)\
**Post date:** [July 23, 2014, 6:12pm UTC](https://forums.unrealengine.com/t/error-ndk-build-failed-ndk-debug-1/289056/4 "2014-07-23T18:12:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dimitrov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dimitrov](https://forums.unrealengine.com/u/dimitrov)\
**Post date:** [September 23, 2014, 12:23am UTC](https://forums.unrealengine.com/t/error-ndk-build-failed-ndk-debug-1/289056/5 "2014-09-23T00:23:14Z")

</div>

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](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)

```

(…)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_05f3eaae1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_05f3eaae1](https://forums.unrealengine.com/u/anonymous_user_05f3eaae1)\
**Post date:** [October 26, 2014, 7:38am UTC](https://forums.unrealengine.com/t/error-ndk-build-failed-ndk-debug-1/289056/6 "2014-10-26T07:38:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_05f3eaae1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_05f3eaae1](https://forums.unrealengine.com/u/anonymous_user_05f3eaae1)\
**Post date:** [October 26, 2014, 8:19am UTC](https://forums.unrealengine.com/t/error-ndk-build-failed-ndk-debug-1/289056/7 "2014-10-26T08:19:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MRVRMAN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MRVRMAN](https://forums.unrealengine.com/u/MRVRMAN)\
**Post date:** [January 18, 2018, 3:39am UTC](https://forums.unrealengine.com/t/error-ndk-build-failed-ndk-debug-1/289056/8 "2018-01-18T03:39:43Z")

</div>

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 ☹

> 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
