I tried to install Android Studio for UE4.25. I upgraded my previous project from 4.24, where I used CodeWorks.
Now I uninstalled CodeWorks, installed Android Studio and got a few errors when running the SetupAndroid.bat file:
No SDK found (or something similar) → fixed it by installing some stuff via “SDK Manager” in Android Studio (dont remember the exact component)
ERROR: JAVA_HOME is set to an invalid directory: C:\NVPACK\jdk1.8.0_77 → fixed by installing OpenJDK 14 and setting the Environment Variable right
Android Studio Path: “C:\Program Files\Android\Android Studio”
Android Studio SDK Path: C:\NVPACK\android-sdk-windows
Using sdkmanager: C:\NVPACK\android-sdk-windows\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:602)
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.
Drücken Sie eine beliebige Taste . . .
And this is the Error I´m completely stuck and lost.
I would appreciate any help!
I ran into this issue as well when going through the steps on the wiki, removing JAVA_HOME seems from my path seems to have resolved it for me as well - thank you!
To anyone who may be following this to find a solution on why the HAXM error persists despite the virtualization is enabled, and the Hyper-V is off. Here is one apparently common thing which may be causing this in Win10: get to Edit Group Policy, Administrative Templates, System, Device guard and there will be two subcategory options. Normally they are set to Default, but you need to set them to Disabled.
Make sure you know what you are doing though, and happy developing! cheers
If I can ask a stupid question,
How / where do you remove JAVA HOME and secondly is there a safe way of backing it up incase it screws over other things on my system?
Another solutionwhich might be better: If you have previously installed java on your machine, instead of removing the env variable JAVA_HOME, you should simply change it’s path to the one that you had installed.
In my case, it was: “C:\Program Files\Java\jre1.8.0_51”, so I pointed the JAVA_HOME to this path. This shall prevent breaking other softwares which might also be using the JAVA_HOME variable to locate the java installation directory to use java.
Beware: if your java version mismatches the android studio java version by a significant margin, then you might face other problems too, maybe simply install the same version of java on your machine as that of the one which android studio has installed and point the env variable to that version instead.
You posted this only a few hours before I had the same issue. Your solution worked! I had two JRE folders, one in C:\Program Files\Android\Android Studio\jre and the other at C:\Program Files\Java\jre1.8.0_301.
Making JAVA_HOMEC:\Program Files\Java\jre1.8.0_301 in environment variables settings fixes it and allows me to run androidsetup.bat without error!
I am in the process of compiling my android game and this should help me fully compile the games and put them out on the google play store etc. Thanks!
edit: I actually had to set the path to this: C:\Program Files\Java\jdk1.8.0_211 after installing jdk8 using chocolatey. this worked. jre doesn’t have tools.jar.
1 - If you have recently installed or updated Android Studio, it installs java version 11, but unreal 4 relies heavily on java 8 as of now, so it is better simply point the variable to that. But keep in mind that if you ever use android studio, you might again need java 11 for some specific library to compile/work, so you might have to change that back OR change android studio settings to make it use java version at a manually defined path (point to java 11).
2 - If your game does not package, remove sdk build tools version 31.0.0 and install 30.0.3 or lower. See my answer here for more details.
set SDKMANAGER=%STUDIO_SDK_PATH%\cmdline-tools\latest\bin\sdkmanager.bat
IF EXIST “%SDKMANAGER%” (
echo Using sdkmanager: %SDKMANAGER%
) ELSE (
set SDKMANAGER=%STUDIO_SDK_PATH%\cmdline-tools\latest\bin\sdkmanager.bat