我试图编译apk时出错

时间:2016-10-14 23:36:47

标签: android android-studio compilation apk

我一直在尝试制作apk并遇到以下错误:

Error:Internal error: (java.lang.UnsupportedClassVersionError) org/jetbrains/jps/android/model/impl/JpsAndroidModelSerializerExtension : Unsupported major.minor version 52.0
java.lang.UnsupportedClassVersionError: org/jetbrains/jps/android/model/impl/JpsAndroidModelSerializerExtension : 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 java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:274)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:363)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
    at com.intellij.util.containers.ContainerUtilRt.copy(ContainerUtilRt.java:179)
    at com.intellij.util.containers.ContainerUtilRt.newArrayList(ContainerUtilRt.java:168)
    at org.jetbrains.jps.plugin.impl.JpsPluginManagerImpl.loadExtensions(JpsPluginManagerImpl.java:18)
    at org.jetbrains.jps.service.impl.JpsServiceManagerImpl.getExtensions(JpsServiceManagerImpl.java:59)
    at org.jetbrains.jps.model.serialization.JpsModelSerializerExtension.getExtensions(JpsModelSerializerExtension.java:46)
    at org.jetbrains.jps.model.serialization.library.JpsLibraryTableSerializer.getRootType(JpsLibraryTableSerializer.java:185)
    at org.jetbrains.jps.model.serialization.library.JpsLibraryTableSerializer.loadLibrary(JpsLibraryTableSerializer.java:115)
    at org.jetbrains.jps.model.serialization.library.JpsLibraryTableSerializer.loadLibrary(JpsLibraryTableSerializer.java:92)
    at org.jetbrains.jps.model.serialization.library.JpsLibraryTableSerializer.loadLibraries(JpsLibraryTableSerializer.java:65)
    at org.jetbrains.jps.model.serialization.JpsGlobalLoader$GlobalLibrariesSerializer.loadExtension(JpsGlobalLoader.java:128)
    at org.jetbrains.jps.model.serialization.JpsGlobalLoader$GlobalLibrariesSerializer.loadExtension(JpsGlobalLoader.java:121)
    at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadComponents(JpsLoaderBase.java:61)
    at org.jetbrains.jps.model.serialization.JpsGlobalLoader.loadGlobalComponents(JpsGlobalLoader.java:83)
    at org.jetbrains.jps.model.serialization.JpsGlobalLoader.load(JpsGlobalLoader.java:73)
    at org.jetbrains.jps.model.serialization.JpsGlobalLoader.loadGlobalSettings(JpsGlobalLoader.java:59)
    at org.jetbrains.jps.model.serialization.impl.JpsSerializationManagerImpl.loadModel(JpsSerializationManagerImpl.java:38)
    at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:45)
    at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:78)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:266)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:232)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:44)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

由于以下原因,您可能会遇到此问题:

  1. 您可能在项目中使用了一些库,这些库使用较新的java版本或较旧的java版本编译,而您的机器jvm不支持。

  2. 您的Android Studio可能已损坏,因此重新安装。

  3. 如果您正在尝试读取序列化对象,该对象使用旧Java版本的新Java版本进行序列化,并且不受jvm支持。

  4. 希望这会对你有帮助。

    干杯