Exception in thread "main" java.lang.UnsupportedClassVersionError - While extracting bundle apks using BundleTool in android

479 Views Asked by At

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/tools/build/bundletool/BundleToolMain : Unsupported major.minor version 52.0

I am trying to run bundletool.jar to extract apks from .aab in android studio.

1

There are 1 best solutions below

0
Ehsan Rafique On

This error occurs when you have installed lower version of jdk and then try to run bundletool.jar which required higher version of jdk to run.

In my case I had jdk 1.7 installed and then I did to steps:

  1. I updated jdk 1.7 to jdk 1.8
  2. Change the jdk path in Environment Variabe "JAVA_HOME" from "C:\Program Files\Java\jdk1.7.0_07" to "C:\Program Files\Java\jdk1.8.0_231"

and everything is working fine.