Download

WHY build failed?

I tried to package the 3rd-person-example android project (https://docs.unrealengine.com/latest/INT/Platforms/Android/GettingStarted/3/index.html) but I kept getting build-failed which is frustrating. I hope somebody might know what is the issue here… Thanks in advance!

1 I am using windows7-64version, UE4.9.2. I installed jdk1.7+sdk+apache ant+ndk with androidWorks1R1(that comes with UE 4.9.2). For no reason at all androidWorks could not download Nsight Tegra Package and I happened to learn that Nsight is not mandatory for non-C++ project, so I just skipped Nsight. Is it due to missing Nsight? IF yes, do I need visual studio?

2 I use android studio and had jdk1.8 and android sdk previously installed on my machine. i checked the system enviroment variables after androidWorks1R1 installation that all enviroment variables are pointing to the stuff installed by androidWorks1R1. So i guess the previous jdk and sdk should not be an issue here??—is it?

3 I tried to play with the minimum/target sdk version, 9/16/19, but it doesn’t help.

4 below is how the logs look like.

MainFrameActions: Packaging (Android (ETC1)): [echo] Resolving Dependencies for google-play-services_lib_rev19…
MainFrameActions: Packaging (Android (ETC1)): [dependency] Library dependencies:
MainFrameActions: Packaging (Android (ETC1)): [dependency] No Libraries
MainFrameActions: Packaging (Android (ETC1)): [dependency]
MainFrameActions: Packaging (Android (ETC1)): [dependency] ------------------
MainFrameActions: Packaging (Android (ETC1)): -code-gen:
MainFrameActions: Packaging (Android (ETC1)): [mergemanifest] Merging AndroidManifest files into one.
MainFrameActions: Packaging (Android (ETC1)): [mergemanifest] Manifest merger disabled. Using project manifest only.
MainFrameActions: Packaging (Android (ETC1)): [echo] Handling aidl files…
MainFrameActions: Packaging (Android (ETC1)): [aidl] No AIDL files to compile.
MainFrameActions: Packaging (Android (ETC1)): [echo] ----------
MainFrameActions: Packaging (Android (ETC1)): [echo] Handling RenderScript files…
MainFrameActions: Packaging (Android (ETC1)): [echo] ----------
MainFrameActions: Packaging (Android (ETC1)): [echo] Handling Resources…
MainFrameActions: Packaging (Android (ETC1)): [aapt] Generating resource IDs…
MainFrameActions: Packaging (Android (ETC1)): [echo] ----------
MainFrameActions: Packaging (Android (ETC1)): [echo] Handling BuildConfig class…
MainFrameActions: Packaging (Android (ETC1)): [buildconfig] Generating BuildConfig class.
MainFrameActions: Packaging (Android (ETC1)): -pre-compile:
MainFrameActions: Packaging (Android (ETC1)): -compile:
MainFrameActions: Packaging (Android (ETC1)): BUILD FAILED
MainFrameActions: Packaging (Android (ETC1)): C:\NVPACK\android-sdk-windows ools\ant\build.xml:601: The following error occurred while executing this line:
MainFrameActions: Packaging (Android (ETC1)): C:\NVPACK\android-sdk-windows ools\ant\build.xml:720: The following error occurred while executing this line:
MainFrameActions: Packaging (Android (ETC1)): C:\NVPACK\android-sdk-windows ools\ant\build.xml:734: java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 52.0
MainFrameActions: Packaging (Android (ETC1)): at java.lang.ClassLoader.defineClass1(Native Method)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
MainFrameActions: Packaging (Android (ETC1)): at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
MainFrameActions: Packaging (Android (ETC1)): at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
MainFrameActions: Packaging (Android (ETC1)): at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
MainFrameActions: Packaging (Android (ETC1)): at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
MainFrameActions: Packaging (Android (ETC1)): at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
MainFrameActions: Packaging (Android (ETC1)): at java.security.AccessController.doPrivileged(Native Method)
MainFrameActions: Packaging (Android (ETC1)): at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.Class.forName0(Native Method)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.Class.forName(Class.java:191)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.doesModernCompilerExist(CompilerAdapterFactory.java:166)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:125)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.Javac.findSupportedFileExtensions(Javac.java:961)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.Javac.scanDir(Javac.java:938)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:909)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.reflect.Method.invoke(Method.java:606)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Task.perform(Task.java:348)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
MainFrameActions: Packaging (Android (ETC1)): at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.reflect.Method.invoke(Method.java:606)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Task.perform(Task.java:348)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.reflect.Method.invoke(Method.java:606)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Task.perform(Task.java:348)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.reflect.Method.invoke(Method.java:606)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Task.perform(Task.java:348)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Target.execute(Target.java:390)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Target.performTasks(Target.java:411)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:302)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:221)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.reflect.Method.invoke(Method.java:606)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Task.perform(Task.java:348)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
MainFrameActions: Packaging (Android (ETC1)): at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
MainFrameActions: Packaging (Android (ETC1)): at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
MainFrameActions: Packaging (Android (ETC1)): at java.lang.reflect.Method.invoke(Method.java:606)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Task.perform(Task.java:348)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Target.execute(Target.java:390)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Target.performTasks(Target.java:411)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Main.runBuild(Main.java:809)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.Main.startAnt(Main.java:217)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
MainFrameActions: Packaging (Android (ETC1)): at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
MainFrameActions: Packaging (Android (ETC1)): Total time: 5 seconds
MainFrameActions: Packaging (Android (ETC1)): BuildCommand.Execute: ERROR: BUILD FAILED
MainFrameActions: Packaging (Android (ETC1)): Program.Main: ERROR: AutomationTool terminated with exception:
MainFrameActions: Packaging (Android (ETC1)): Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: cmd.exe failed with args /c “C:/NVPACK/apache-ant-1.8.2/bin/ant.bat” debug
MainFrameActions: Packaging (Android (ETC1)): Stacktrace: at UnrealBuildTool.Android.UEDeployAndroid.RunCommandLineProgramAndThrowOnError(String WorkingDirectory, String Command, String Params, String OverrideDesc, Boolean bUseShellExecute)
MainFrameActions: Packaging (Android (ETC1)): at UnrealBuildTool.Android.UEDeployAndroid.MakeApk(String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bMakeSeparateApks, Boolean bIncrementalPackage, Boolean bDisallowPackagingDataInApk)
MainFrameActions: Packaging (Android (ETC1)): at UnrealBuildTool.Android.UEDeployAndroid.PrepForUATPackageOrDeploy(String ProjectName, String ProjectDirectory, String ExecutablePath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bIsDataDeploy)
MainFrameActions: Packaging (Android (ETC1)): at AndroidPlatform.Package(ProjectParams Params, DeploymentContext SC, Int32 WorkingCL)
MainFrameActions: Packaging (Android (ETC1)): at Project.Package(ProjectParams Params, Int32 WorkingCL)
MainFrameActions: Packaging (Android (ETC1)): at BuildCookRun.DoBu
MainFrameActions: Packaging (Android (ETC1)): ildCookRun(ProjectParams Params)
MainFrameActions: Packaging (Android (ETC1)): at BuildCommand.Execute()
MainFrameActions: Packaging (Android (ETC1)): at AutomationTool.Automation.Execute(List1 CommandsToExecute, CaselessDictionary1 Commands)
MainFrameActions: Packaging (Android (ETC1)): at AutomationTool.Automation.Process(String] CommandLine)
MainFrameActions: Packaging (Android (ETC1)): at AutomationTool.Program.MainProc(Object Param)
MainFrameActions: Packaging (Android (ETC1)): at AutomationTool.InternalUtils.RunSingleInstance(Action`1 Main, Object Param)
MainFrameActions: Packaging (Android (ETC1)): at AutomationTool.Program.Main()
MainFrameActions: Packaging (Android (ETC1)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Android (ETC1)): Program.Main: AutomationTool exiting with ExitCode=Error_Unknown
MainFrameActions: Packaging (Android (ETC1)): Domain_ProcessExit
MainFrameActions: Packaging (Android (ETC1)): copying UAT log files…
MainFrameActions: Packaging (Android (ETC1)): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
MainFrameActions: Packaging (Android (ETC1)): BUILD FAILED
PackagingResults:Error: Error Unknown Error

I do not remember where it is, you need to find that other log yourself.
RunUAT runs some commandline tool that creates log, in that log you have more information.

This RunUAT error usually happens when you have unfinished installation of android sdk, sometimes, name of project matters, you need to name apk in properties in certain way. But I would first check that other log, and check android SDK installation.

Hey nanyi545,

If you haven’t already, please upload a full .txt version of your output logs to an AnswerHub post. We’ll be able to figure out what’s going on with your packaging process. Include a screenshot of your Android SDK as well.

Thank you!

Dear all: Thanks for your suggestions.

It seems the previously installed android enviroment(JDK+SDK+android studio) had some impact .

I deleted all JDK and SDK and reinstalled UE and androidWorks1R1(full installation). It is working fine now.