SetupAndroid.bat Error (maybe java release problem?)

Hello,
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
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(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.
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

2 Likes

Hello!
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!

2 Likes

this worked for me, too!

It did solve my question, thank you sincerely.

Hello,
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
    change

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

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

That’s it.

55 Likes

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:

Thanks!

rocking. Thanks!

Thank you! This worked!