4

I want to use Qt to make an app for Android (and later hopefully iOS). I have downloaded the Android SDK Manager command line tool, and ran sdkmanager --list, but it gives the following error:

C:\Users\MyUser\Development\Android\sdk\tools\bin>sdkmanager --list

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/SdkManagerCli : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

I'm using Windows 10.

I've added the path to the SDK Manager to the windows environment path, and have tried to run the command from both the bin directory and from another directory. I still get the error.

Some similar issues suggested to check/update the Java SE Development Kit. I've tried both version 7, 8 and 9, but I still get the same error.

I've also tried to run the command prompt as administrator. Still the same error.

I'm completely out of ideas...

Does anyone know what I'm doing wrong? I have no previous experience with Android app development or Java.

KMK
  • 1,439
  • 5
  • 21
  • 39
  • See this link for solutions http://devlog.markhlavac.com/2017/06/30/installing-android-sdk-for-unity3d-using-sdk-tools-and-cli/ (1)Remove all SDKs and try clean installation with only v25.(2) solved this problem. you need to install Java SE Development Kit 8u144 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html (3)buildToolsVersion download "23.0.3" – Jon Goodwin Oct 08 '17 at 11:54
  • I actually followed the guide on that link when installing it all. But the issue was that I had to manually update the **JAVA_HOME** environment variable. Thanks anyway :) – KMK Oct 09 '17 at 18:44

1 Answers1

17

Turned out that installing the Java SE Development kits wasn't enough. I also needed to manually update the system variable JAVA_HOME to point to the new directory.

Now I can run the SDK Manager without problems.

KMK
  • 1,439
  • 5
  • 21
  • 39
  • may I know more details about it? – Li Xing Mar 05 '19 at 02:30
  • 1
    My system variable of JAVA_HOME was pointing at 1.7. When I switched to 1.8, I could update SDK manager. I also referred to https://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0 – TGLEE Aug 11 '20 at 14:42