I’m getting this error (UE4 4.26.2) when building for android devices (specifically my Oculus Quest, but I get the same error when I try building to all android devices). Here’s my log:
BUILD FAILED
Running AutomationTool...
Parsing command line: -ScriptsForProject="C:/Users/DHern/Documents/Unreal Projects/GolfQuest/GolfQuest.uproject" BuildCookRun -project="C:/Users/DHern/Documents/Unreal Projects/GolfQuest/GolfQuest.uproject" -noP4 -clientconfig=Development -serverconfig=Development -nocompile -nocompileeditor -installed -ue4exe="C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\Win64\UE4Editor-Cmd.exe" -utf8output -platform=Android -targetplatform=Android -cookflavor=ASTC -ini:Game:[/Script/UnrealEd.ProjectPackagingSettings]:BlueprintNativizationMethod=Disabled -build -cookonthefly -nokill -map= -compressed -stage -deploy -cmdline=" -Messaging" -device=Android_ASTC@1PASH9B7TK9167 -addcmdline="-SessionId=6042F49340A014B8DF7A609D63C16E8D -SessionOwner='DHern' -SessionName='Quest (1PASH9B7TK9167)' " -run
Setting up ProjectParams for C:\Users\DHern\Documents\Unreal Projects\GolfQuest\GolfQuest.uproject
********** BUILD COMMAND STARTED **********
Running: C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\DotNET\UnrealBuildTool.exe GolfQuest Android Development -Project="C:\Users\DHern\Documents\Unreal Projects\GolfQuest\GolfQuest.uproject" "C:\Users\DHern\Documents\Unreal Projects\GolfQuest\GolfQuest.uproject" -NoUBTMakefiles -remoteini="C:\Users\DHern\Documents\Unreal Projects\GolfQuest" -skipdeploy -ini:Game:[/Script/UnrealEd.ProjectPackagingSettings]:BlueprintNativizationMethod=Disabled -Manifest="C:\Users\DHern\Documents\Unreal Projects\GolfQuest\Intermediate\Build\Manifest.xml" -NoHotReload -log="C:\Users\DHern\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.26\UBT-GolfQuest-Android-Development.txt"
Using 'git status' to determine working set for adaptive non-unity build (C:\Users\DHern\Documents\Unreal Projects\GolfQuest).
ERROR: Platform Android is not a valid platform to build. Check that the SDK is installed properly.
Took 0.7113921s to run UnrealBuildTool.exe, ExitCode=6
UnrealBuildTool failed. See log for more details. (C:\Users\DHern\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.26\UBT-GolfQuest-Android-Development.txt)
AutomationTool exiting with ExitCode=6 (6)
I’ve been struggling with issues building for my Quest for several hours; nothing I read has solved my issue. I have my SDK, NDK, and JRE directories explicitly specified in my project settings:
Location of Android SDK (the directory usually contains 'android-sdk-'): C:/Users/[me]/AppData/Local/Android/Sdk
Location of Android NDK (the directory usually contains 'android-ndk-'): C:/Users/[me]/AppData/Local/Android/Sdk/ndk
Location of JAVA (the directory usually contains 'android-ndk-'): C:/Program Files/Android/Android Studio/jre
SDK API Level (specific version, 'latest', or 'matchndk' - see tooltip): latest
NDK API Level (specific version or 'latest' - see tooltip): android-21
I have also tried running the included SetupAndroid.bat
and always get the following error log:
Android Studio Path: C:\Program Files\Android\Android Studio
Android Studio SDK Path: C:\Users\DHern\AppData\Local\Android\Sdk
Using sdkmanager: C:\Users\DHern\AppData\Local\Android\Sdk\tools\bin\sdkmanager.bat
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
Update failed. Please check the Android Studio install.
I couldn’t find any fixes online to help me with this, but for what it’s worth I made sure that I have all of the correct versions of the platform tools specified on Line 75 from the .bat:
call "%SDKMANAGER%" "platform-tools" "platforms;android-28" "build-tools;28.0.3" "cmake;3.10.2.4988404" "ndk;21.4.7075529"
I would appreciate any help! I haven’t found any answers for this anywhere.