web-dev-qa-db-fra.com

Android Device Monitor ne se lancera pas, depuis Android Studio ou depuis Terminal - UnsupportedClassVersionError

J'obtiens l'erreur suivante lorsque j'essaie de lancer Android Device Monitor depuis la fenêtre Outils dans Android Studio sur un Mac.

enter image description here

et lorsque j'ouvre le fichier journal, je trouve un rapport d'erreur très similaire à l'autre SO questions similaires à cela, en particulier celui-ci . Cependant, l'utilisation de Sudo n'a pas fonctionné pour moi, bien que j'obtienne des données d'erreur similaires, bien que beaucoup plus courtes:

Macs-MBP:tools macuser$ Sudo ./monitor
Password:
Exception in thread "main" Java.lang.UnsupportedClassVersionError: com/Android/archquery/Main : Unsupported major.minor version 52.0
    at Java.lang.ClassLoader.defineClass1(Native Method)
    at Java.lang.ClassLoader.defineClassCond(ClassLoader.Java:637)
    at Java.lang.ClassLoader.defineClass(ClassLoader.Java:621)
    at Java.security.SecureClassLoader.defineClass(SecureClassLoader.Java:141)
    at Java.net.URLClassLoader.defineClass(URLClassLoader.Java:283)
    at Java.net.URLClassLoader.access$000(URLClassLoader.Java:58)
    at Java.net.URLClassLoader$1.run(URLClassLoader.Java:197)
    at Java.security.AccessController.doPrivileged(Native Method)
    at Java.net.URLClassLoader.findClass(URLClassLoader.Java:190)
    at Java.lang.ClassLoader.loadClass(ClassLoader.Java:306)
    at Sun.misc.Launcher$AppClassLoader.loadClass(Launcher.Java:301)
    at Java.lang.ClassLoader.loadClass(ClassLoader.Java:247)
./monitor: line 41: /Users/macuser/Library/Android/sdk/tools/lib/monitor-/monitor.app/Contents/MacOS/monitor: No such file or directory
./monitor: line 41: exec: /Users/macuser/Library/Android/sdk/tools/lib/monitor-/monitor.app/Contents/MacOS/monitor: cannot execute: No such file or directory

Backstory: Après avoir fait une nouvelle installation complète Android Studio sur cet ordinateur portable (El Capitan), j'ai tenté de lancer le moniteur depuis l'intérieur de l'IDE. Il s'est plaint que son exécution nécessitait Java 1.6. J'ai donc installé Java 6. Ensuite, quand je l'ai essayé, j'ai reçu le message d'erreur ci-dessus.

J'obtiens ce qui suit lorsque je cours depuis Terminal Java_home -V

Matching Java Virtual Machines (2):
    1.6.0_65-b14-468, x86_64:   "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    1.6.0_65-b14-468, i386: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

Le contenu du fichier journal est (malheureusement a dû être supprimé en raison des limitations de saisie de texte pour la publication):

!SESSION 2017-03-07 14:46:16.923 -----------------------------------------------
Eclipse.buildId=unknown
Java.version=1.6.0_65
Java.vendor=Apple Inc.
BootLoader constants: OS=macosx, Arch=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -keyring /Users/macuser/.Eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -Arch x86_64 -data @noDefault -keyring /Users/macuser/.Eclipse_keyring -showlocation

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.397
!MESSAGE Bundle reference:file:org.Apache.ant_1.8.3.v201301120609/@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.400
!MESSAGE Bundle reference:file:org.Apache.jasper.glassfish_2.2.2.v201205150955.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.401
!MESSAGE Bundle reference:file:org.Apache.lucene.core_2.9.1.v201101211721.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.424
!MESSAGE Bundle reference:file:org.Eclipse.help.base_3.6.101.v201302041200.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.425
!MESSAGE Bundle reference:file:org.Eclipse.help.ui_3.5.201.v20130108-092756.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.425
!MESSAGE Bundle reference:file:org.Eclipse.help.webapp_3.6.101.v20130116-182509.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.426
!MESSAGE Bundle reference:file:org.Eclipse.jetty.server_8.1.3.v20120522.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.429
!MESSAGE Bundle reference:file:org.Eclipse.platform.doc.user_4.2.2.v20130121-200410.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.430
!MESSAGE Bundle reference:file:org.Eclipse.team.core_3.6.100.v20120524-0627.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.430
!MESSAGE Bundle reference:file:org.Eclipse.team.ui_3.6.201.v20130125-135424.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.431
!MESSAGE Bundle reference:file:org.Eclipse.ui.cheatsheets_3.4.200.v20120521-2344.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.432
!MESSAGE Bundle reference:file:org.Eclipse.ui.intro_3.4.200.v20120521-2344.jar@4 not found.

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:17.924
!MESSAGE An error occurred while automatically activating bundle com.Android.ide.Eclipse.monitor (4).
!STACK 0
org.osgi.framework.BundleException: The activator com.Android.ide.Eclipse.monitor.MonitorPlugin for bundle com.Android.ide.Eclipse.monitor is invalid
    at org.Eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.Java:172)
    at org.Eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.Java:679)
    at org.Eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.Java:381)
    at org.Eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.Java:300)
    at org.Eclipse.osgi.framework.util.SecureAction.start(SecureAction.Java:440)
    at org.Eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.Java:263)
    at org.Eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.Java:107)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.Java:469)
    at org.Eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.Java:216)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.Java:395)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.Java:464)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.Java:421)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.Java:412)
    at org.Eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.Java:107)
    at Java.lang.ClassLoader.loadClass(ClassLoader.Java:247)
    at org.Eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.Java:340)
    at org.Eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.Java:229)
    at org.Eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.Java:1212)
    at org.Eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.Java:174)
    at org.Eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.Java:905)
    at org.Eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.Java:243)
    at org.Eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.Java:55)
    at org.Eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.Java:191)
    at org.Eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.Java:110)
    at org.Eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.Java:79)
    at org.Eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.Java:353)
    at org.Eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.Java:180)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:39)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:25)
    at Java.lang.reflect.Method.invoke(Method.Java:597)
    at org.Eclipse.equinox.launcher.Main.invokeFramework(Main.Java:629)
    at org.Eclipse.equinox.launcher.Main.basicRun(Main.Java:584)
    at org.Eclipse.equinox.launcher.Main.run(Main.Java:1438)
Caused by: Java.lang.UnsupportedClassVersionError: com/Android/prefs/AndroidLocation$AndroidLocationException : Unsupported major.minor version 52.0
    at Java.lang.ClassLoader.defineClass1(Native Method)
    at Java.lang.ClassLoader.defineClassCond(ClassLoader.Java:637)
    at Java.lang.ClassLoader.defineClass(ClassLoader.Java:621)
    at org.Eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.Java:188)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.Java:632)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.Java:614)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.Java:568)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.Java:492)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.Java:465)
    at org.Eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.Java:216)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.Java:395)
    at org.Eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.Java:35)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.Java:461)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.Java:421)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.Java:412)
    at org.Eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.Java:107)
    at Java.lang.ClassLoader.loadClass(ClassLoader.Java:247)
    at com.Android.ide.Eclipse.monitor.MonitorPlugin.<clinit>(MonitorPlugin.Java:28)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.Java:39)
    at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.Java:27)
    at Java.lang.reflect.Constructor.newInstance(Constructor.Java:513)
    at Java.lang.Class.newInstance0(Class.Java:357)
    at Java.lang.Class.newInstance(Class.Java:310)
    at org.Eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.Java:167)
    ... 33 more

!ENTRY org.Eclipse.osgi 2 0 2017-03-07 14:46:18.017
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.017
!MESSAGE Bundle initial@reference:file:plugins/org.Eclipse.equinox.http.jetty_3.0.1.v20121109-203239.jar was not resolved.
!SUBENTRY 2 org.Eclipse.equinox.http.jetty 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing imported package org.Eclipse.jetty.server.ssl_[8.0.0,9.0.0).
!SUBENTRY 2 org.Eclipse.equinox.http.jetty 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing imported package org.Eclipse.jetty.server.nio_[8.0.0,9.0.0).
!SUBENTRY 2 org.Eclipse.equinox.http.jetty 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing imported package org.Eclipse.jetty.server.session_[8.0.0,9.0.0).
!SUBENTRY 2 org.Eclipse.equinox.http.jetty 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing imported package org.Eclipse.jetty.server_[8.0.0,9.0.0).
!SUBENTRY 2 org.Eclipse.equinox.http.jetty 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing imported package org.Eclipse.jetty.server.bio_[8.0.0,9.0.0).
!SUBENTRY 2 org.Eclipse.equinox.http.jetty 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing imported package org.Eclipse.jetty.server.handler_[8.0.0,9.0.0).
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.017
!MESSAGE Bundle initial@reference:file:plugins/org.Eclipse.ltk.ui.refactoring_3.7.0.v20120523-1543.jar was not resolved.
!SUBENTRY 2 org.Eclipse.ltk.ui.refactoring 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing required bundle org.Eclipse.team.core_[3.4.100,4.0.0).
!SUBENTRY 2 org.Eclipse.ltk.ui.refactoring 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing required bundle org.Eclipse.team.ui_[3.4.100,4.0.0).
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.017
!MESSAGE Bundle initial@reference:file:plugins/org.Eclipse.platform_4.2.2.v201302041200/ was not resolved.
!SUBENTRY 2 org.Eclipse.platform 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing required bundle org.Eclipse.ui.intro_[3.2.0,4.0.0).
!SUBENTRY 2 org.Eclipse.platform 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing required capability Require-Capability: osgi.ee; filter="(|(&(osgi.ee=JavaSE)(version=1.4))(&(osgi.ee=CDC/Foundation)(version=1.0))(&(osgi.ee=JavaSE)(version=1.3)))".
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.017
!MESSAGE Bundle initial@reference:file:plugins/org.Eclipse.ui.intro.universal_3.2.600.v20120912-155524/ was not resolved.
!SUBENTRY 2 org.Eclipse.ui.intro.universal 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing required bundle org.Eclipse.ui.intro_[3.4.0,4.0.0).
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.017
!MESSAGE Bundle initial@reference:file:plugins/org.Eclipse.equinox.jsp.jasper_1.0.400.v20120912-130548.jar was not resolved.
!SUBENTRY 2 org.Eclipse.equinox.jsp.jasper 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing imported package org.Apache.jasper.servlet_[0.0.0,6.0.0).
!SUBENTRY 2 org.Eclipse.equinox.jsp.jasper 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing required capability Require-Capability: osgi.ee; filter="(|(&(osgi.ee=CDC/Foundation)(version=1.0))(&(osgi.ee=JavaSE)(version=1.3)))".
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.017
!MESSAGE Bundle initial@reference:file:plugins/org.Apache.lucene_2.9.1.v201101211721.jar was not resolved.
!SUBENTRY 2 org.Apache.lucene 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing required bundle org.Apache.lucene.core_[2.9.1,3.0.0).
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.017
!MESSAGE Bundle initial@reference:file:plugins/org.Eclipse.jetty.security_8.1.3.v20120522.jar was not resolved.
!SUBENTRY 2 org.Eclipse.jetty.security 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing imported package org.Eclipse.jetty.server_[8.1.0,9.0.0).
!SUBENTRY 2 org.Eclipse.jetty.security 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing imported package org.Eclipse.jetty.server.handler_[8.1.0,9.0.0).
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.017
!MESSAGE Bundle initial@reference:file:plugins/org.Apache.lucene.analysis_2.9.1.v201101211721.jar was not resolved.
!SUBENTRY 2 org.Apache.lucene.analysis 2 0 2017-03-07 14:46:18.017
!MESSAGE Missing required bundle org.Apache.lucene.core_[2.9.1,3.0.0).
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.017
!MESSAGE Bundle initial@reference:file:plugins/org.Eclipse.jetty.servlet_8.1.3.v20120522.jar was not resolved.
!SUBENTRY 2 org.Eclipse.jetty.servlet 2 0 2017-03-07 14:46:18.018
!MESSAGE Missing imported package org.Eclipse.jetty.server.handler_[8.1.0,9.0.0).
!SUBENTRY 2 org.Eclipse.jetty.servlet 2 0 2017-03-07 14:46:18.018
!MESSAGE Missing imported package org.Eclipse.jetty.server.session_[8.1.0,9.0.0).
!SUBENTRY 2 org.Eclipse.jetty.servlet 2 0 2017-03-07 14:46:18.018
!MESSAGE Missing imported package org.Eclipse.jetty.server.nio_[8.1.0,9.0.0).
!SUBENTRY 2 org.Eclipse.jetty.servlet 2 0 2017-03-07 14:46:18.018
!MESSAGE Missing imported package org.Eclipse.jetty.server_[8.1.0,9.0.0).
!SUBENTRY 2 org.Eclipse.jetty.servlet 2 0 2017-03-07 14:46:18.018
!MESSAGE Missing imported package org.Eclipse.jetty.server.ssl_[8.1.0,9.0.0).
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.018
!MESSAGE Bundle initial@reference:file:plugins/org.Eclipse.equinox.jsp.jasper.registry_1.0.300.v20120912-130548.jar was not resolved.
!SUBENTRY 2 org.Eclipse.equinox.jsp.jasper.registry 2 0 2017-03-07 14:46:18.018
!MESSAGE Missing required capability Require-Capability: osgi.ee; filter="(|(&(osgi.ee=CDC/Foundation)(version=1.0))(&(osgi.ee=JavaSE)(version=1.3)))".

!ENTRY org.Eclipse.osgi 2 0 2017-03-07 14:46:18.037
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.Eclipse.osgi 2 0 2017-03-07 14:46:18.037
!MESSAGE Bundle org.Apache.lucene_2.9.1.v201101211721 [24] was not resolved.
!SUBENTRY 2 org.Apache.lucene 2 0 2017-03-07 14:46:18.037
!MESSAGE Missing required bundle org.Apache.lucene.core_[2.9.1,3.0.0).
!SUBENTRY 2 org.Apache.lucene 2 0 2017-03-07 14:46:18.037
!MESSAGE Missing optionally required bundle org.Apache.lucene.analysis_[2.9.1,3.0.0).
!SUBENTRY 2 org.Apache.lucene 2 0 2017-03-07 14:46:18.037
!MESSAGE Missing optionally required bundle org.Apache.lucene.highlighter_[2.9.1,3.0.0).
!SUBENTRY 2 org.Apache.lucene 2 0 2017-03-07 14:46:18.037
!MESSAGE Missing optionally required bundle org.Apache.lucene.memory_[2.9.1,3.0.0).
!SUBENTRY 2 org.Apache.lucene 2 0 2017-03-07 14:46:18.037
!MESSAGE Missing optionally required bundle org.Apache.lucene.queries_[2.9.1,3.0.0).

. . .

!ENTRY org.Eclipse.osgi 4 0 2017-03-07 14:46:18.041
!MESSAGE Application error
!STACK 1
org.Eclipse.core.runtime.CoreException: Plug-in com.Android.ide.Eclipse.monitor was unable to load class com.Android.ide.Eclipse.monitor.MonitorApplication.
    at org.Eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.Java:194)
    at org.Eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.Java:176)
    at org.Eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.Java:905)
    at org.Eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.Java:243)
    at org.Eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.Java:55)
    at org.Eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.Java:191)
    at org.Eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.Java:110)
    at org.Eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.Java:79)
    at org.Eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.Java:353)
    at org.Eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.Java:180)
    at Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:39)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:25)
    at Java.lang.reflect.Method.invoke(Method.Java:597)
    at org.Eclipse.equinox.launcher.Main.invokeFramework(Main.Java:629)
    at org.Eclipse.equinox.launcher.Main.basicRun(Main.Java:584)
    at org.Eclipse.equinox.launcher.Main.run(Main.Java:1438)
Caused by: org.osgi.framework.BundleException: The activator com.Android.ide.Eclipse.monitor.MonitorPlugin for bundle com.Android.ide.Eclipse.monitor is invalid
    at org.Eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.Java:172)
    at org.Eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.Java:679)
    at org.Eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.Java:381)
    at org.Eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.Java:300)
    at org.Eclipse.osgi.framework.util.SecureAction.start(SecureAction.Java:440)
    at org.Eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.Java:263)
    at org.Eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.Java:107)
    ... 27 more
Caused by: Java.lang.UnsupportedClassVersionError: com/Android/prefs/AndroidLocation$AndroidLocationException : Unsupported major.minor version 52.0
    at Java.lang.ClassLoader.defineClass1(Native Method)
    at Java.lang.ClassLoader.defineClassCond(ClassLoader.Java:637)
    at Java.lang.ClassLoader.defineClass(ClassLoader.Java:621)
    at org.Eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.Java:188)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.Java:632)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.Java:614)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.Java:568)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.Java:492)
    at org.Eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.Java:465)
    at org.Eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.Java:216)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.Java:395)
    at org.Eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.Java:35)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.Java:461)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.Java:421)
    at org.Eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.Java:412)
    at org.Eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.Java:107)
    at Java.lang.ClassLoader.loadClass(ClassLoader.Java:247)
    at com.Android.ide.Eclipse.monitor.MonitorPlugin.<clinit>(MonitorPlugin.Java:28)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.Java:39)
    at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.Java:27)
    at Java.lang.reflect.Constructor.newInstance(Constructor.Java:513)
    at Java.lang.Class.newInstance0(Class.Java:357)
    at Java.lang.Class.newInstance(Class.Java:310)
    at org.Eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.Java:167)
    ... 33 more
27
Alyoshak

J'ai le même problème. Sur la base du fichier journal, la nouvelle version de Android Studio nécessite Java 8 "Unsupported major.minor version 52.0": nsupported major.minor version 52.

J'utilise Linux, j'ai actuellement Java8 installé, donc j'avais juste besoin d'utiliser:

update-alternatives --config Java

et

update-alternatives --config javac

alors tout a fonctionné.

Il semble que vous utilisiez un Mac, vous devrez peut-être ou non effectuer les opérations suivantes après avoir installé Java 8: Installé Java = 7 sur Mac OS X mais Terminal utilise toujours la version 6

Informations provenant de Version 52.0 major.minor non prise en charge source: wikipedia

  • J2SE 8 = 52
  • J2SE 7 = 51
  • J2SE 6.0 = 50
  • J2SE 5.0 = 49
  • JDK 1,4 = 48
  • JDK 1,3 = 47
  • JDK 1,2 = 46
  • JDK 1,1 = 45
15
James Nelson

Confusément, je n'avais pas installé Java 8 dans un emplacement partagé (uniquement la version fournie dans Android Studio). L'installer via homebrew a résolu mon problème).

brew cask install Java

$ Java -version
Java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
7
Inti

Android Studio est livré avec Java 1.8 intégré, donc ce n'était pas un problème lorsque vous développez Android app. Mais lorsque vous lancez Android Device Monitor, il utilise externe Java qui s'exécute sur votre système d'exploitation. Si vous avez préinstallé Java avant, il ne sera pas un problème. Sinon, vous serez confronté au même problème.

J'ai essayé de définir le chemin Java_HOME sur Java emballé dans Android Studio. Cela ne fonctionne pas, probablement parce qu'il s'agit de la version openjdk.

Ma solution était de télécharger Java JDK 1.8 d'Oracle et de l'installer sur mon ordinateur.

3
4tee

Si vous ouvrez le message d'erreur particulier, vous verrez la première ligne du message d'erreur comme ci-dessous.

!SESSION 2017-12-20 08:17:02.597 -----------------------------------------------
Eclipse.buildId=unknown
Java.version=9.0.1
Java.vendor=Oracle Corporation

Voilà ce que j'ai. J'ai installé à la fois Java 8 et 9 dans mon Mac et défini Java 8 par défaut. Selon le message d'erreur Java, le périphérique virtuel a pris Java 9 mais son besoin 8. C'est là que le problème s'est produit. J'ai donc désinstallé le Java 9 de ma machine, puis il a commencé à fonctionner correctement.

1
Nishara MJ

La réponse ci-dessus n'a pas fonctionné pour moi. J'utilise Java8, les deux Android Java_HOME et /usr/bin/Java. Ce qui est plus étrange pour moi, c'est que mon répertoire tools/manque également l'outil uiautomationviewer. Je me suis donc demandé si quelque chose s'était mal passé lors de l'installation.

Ce que j'ai fini par faire était de télécharger une version plus ancienne des outils SDK (j'ai suivi les instructions ici ), et remplacé le dossier sdk/tools. Et cela a fonctionné ....

0
katie

J'ai eu le même problème. Win10 + JDK 12 + Android Sdk. Lorsque j'ai exécuté "monitor.bat", c'est exactement le même problème. Je suppose que l'application moniteur ne peut pas reconginiser la dernière Java convention de dénomination des versions. J'installe JRE 8 (comme suit), le problème a disparu.

c:\>Java -version Java version "1.8.0_221" Java(TM) SE Runtime Environment (build 1.8.0_221-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

0
user9736507

Essayez de faire un clic droit sur sdk/tools/monitor.bat et cliquez sur "Exécuter en tant qu'administrateur"

0
Fly Later

Le même problème a été observé sur: macOS Sierra 10.12.6 Android Studio 3.0.1

A été résolu par: Désinstallation Java SE Development Kit 8u 152 Et Installation Java SE Development Kit 8u151 à partir de: http://www.Oracle.com/technetwork/Java/javase/downloads/jdk8-downloads-2133151.html

0
Sergio Odintsov