Download

why Build failed on UE4.9.2

I tried to package the 3rd-person-example project (https://docs.unrealengine.com/latest/INT/Platforms/Android/GettingStarted/3/index.html) but I kep getting below error logs. I hope I could get some hint in the forum and I would like to thank you guys in advance.

  1. I installed jdk1.7/sdk/apache ant/ndk using AndroidWorks-1R1 (that comes with UE4.9.2). For no reasone at all, the Nsight Tegra Package just could not be downloaded, so I skipped it. And I happend to learn from this thread(https://forums.unrealengine.com/showthread.php?90391-Dev-for-Android-Step-by-Step) that Nsight Tegra Package is not mandatory for non-C++project.

  2. I had android studio previously on my machine(windows 7, 64version), so I already have jdk1.8 and sdk. But I checked the system enviroment variables after the installation of AndroidWorks, all enviroment variables are pointing to the stuff installed by AndroidWorks. So I believe the older JDK and sdk should not be an issue???–is this correct or not?

  3. I tried to play with the minimum/target sdk version 9/16/19… doesn’t work.

MainFrameActions: Packaging (Android (ETC1)): [getbuildtools] Using latest Build Tools: 22.0.1
MainFrameActions: Packaging (Android (ETC1)): [echo] Resolving Build Target for google-play-services_lib_rev19…
MainFrameActions: Packaging (Android (ETC1)): [gettarget] Project Target: Android 4.4.2
MainFrameActions: Packaging (Android (ETC1)): [gettarget] API level: 19
MainFrameActions: Packaging (Android (ETC1)): [echo] ----------
MainFrameActions: Packaging (Android (ETC1)): [echo] Creating output directories if needed…
MainFrameActions: Packaging (Android (ETC1)): [mkdir] Created dir: C:\Users\Administrator\Documents\Unreal Projects\androidProject\Intermediate\Android\APK\JavaLibs\google-play-services_lib_rev19\bin
MainFrameActions: Packaging (Android (ETC1)): [mkdir] Created dir: C:\Users\Administrator\Documents\Unreal Projects\androidProject\Intermediate\Android\APK\JavaLibs\google-play-services_lib_rev19\bin\res
MainFrameActions: Packaging (Android (ETC1)): [mkdir] Created dir: C:\Users\Administrator\Documents\Unreal Projects\androidProject\Intermediate\Android\APK\JavaLibs\google-play-services_lib_rev19\bin\rsObj
MainFrameActions: Packaging (Android (ETC1)): [mkdir] Created dir: C:\Users\Administrator\Documents\Unreal Projects\androidProject\Intermediate\Android\APK\JavaLibs\google-play-services_lib_rev19\bin\rsLibs
MainFrameActions: Packaging (Android (ETC1)): [mkdir] Created dir: C:\Users\Administrator\Documents\Unreal Projects\androidProject\Intermediate\Android\APK\JavaLibs\google-play-services_lib_rev19\gen
MainFrameActions: Packaging (Android (ETC1)): [mkdir] Created dir: C:\Users\Administrator\Documents\Unreal Projects\androidProject\Intermediate\Android\APK\JavaLibs\google-play-services_lib_rev19\bin\classes
MainFrameActions: Packaging (Android (ETC1)): [mkdir] Created dir: C:\Users\Administrator\Documents\Unreal Projects\androidProject\Intermediate\Android\APK\JavaLibs\google-play-services_lib_rev19\bin\dexedLibs
MainFrameActions: Packaging (Android (ETC1)): [echo] ----------
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: 6 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.DoBuildCookRun(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

Hi nanyi545,

javac is used to compile the java code by Ant. It looks like you have a mismatch of the jdk for the tools runtime. Check you are using java 1.7 as JAVA_HOME, ANT_HOME points to the apache-ant-1.8.2 and ANDROID_HOME points to the android-sdk-windows. All three should be in the NVPACK installed with AndroidWorks.

Hi Chris, you are probably right.

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