SetupAndroid.bat Error (maybe java release problem?)

I know that very much people already had this issue, but I looked at all the tutorials I found, and I didn’t manage to fix my issue yet. I would be very happy if anybody could help me :

Following the steps for “Setting Up Android SDK and NDK for Unreal” (Setting Up Android SDK and NDK for Unreal | Unreal Engine Documentation) it is mandatory to execute a file named “SetupAndroid.bat”, in order to finish the process of the set up (it is the last step of the process)

But instead of asking me to accept the Android SDK license agreement, it shows me this warning message :

Android Studio Path: C:\Program Files\Android\Android Studio
Android Studio SDK Path: C:\Users\c\AppData\Local\Android\Sdk
Using sdkmanager: C:\Users\c\AppData\Local\Android\Sdk\tools\bin\sdkmanager.bat
Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
at java.base/java.lang.ClassLoader.loadClass(
… 5 more
Update failed. Please check the Android Studio install.
Appuyez sur une touche pour continuer…

Anybody can tell me what I can do ? I already tried to change my java release for 8 release, but there is no change…

Thank you very much


Same problem here. If I find a solution I will let you know.

Hi again, try to uninstall it and download the 4.0 version instead the update (and don´t update to the newer one when prompted). It did the trick for me.
Good luck!


this worked for me, too!

It did solve my question, thank you sincerely.

I found one solution.

  1. install cmdline-tools with Android Studio (setting → Appearance&Behavior->SystemSettings-> SDK tools : check Android SDK Command-line Tools(latest) )
  2. modify SetupAndroid.bat

set SDKMANAGER=%STUDIO_SDK_PATH%\tools\bin\sdkmanager.bat

set SDKMANAGER=%STUDIO_SDK_PATH%\cmdline-tools\latest\bin\sdkmanager.bat

That’s it.


wow, thank you! This unlocked me for the next steps. I modifed that file as you mentioned and the exception went away.

Thank you so much, this worked!

God bless you! it’s worked!

Use jdk 8x not 17 *

Thanks a lot

Hours after hours. How can I send you a cup of coffee? This worked for.
Now for the next problem : Unable to locate local Android NDK location. Did you run SetupAndroid to install it?

After wasting half of my day ,finally it solved .
Thank you so much .

This works for me, can we suggest this “workaround” to Unreal Engine official?

Thanks, this should be an official solution.

Just here to pile on the thanks!

Thanks a lot. :slightly_smiling_face:


rocking. Thanks!

Thank you! This worked!