簡體   English   中英

打開 Android 設備監視器時缺少約束

[英]Missing Constraint when opening Android Device Monitor

啟動monitor ,它會崩潰並將以下內容寫入其日志文件:

org.osgi.framework.BundleException: The bundle "org.eclipse.core.runtime_3.8.0.v20120912-155025 [44]" could not be resolved. Reason: Missing Constraint: Bundle-    RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,J2SE-1.3
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
    at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.equinox.common 4 0 2016-03-18 10:50:26.908
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.common_3.6.100.v20120522-1841 [83]" could not be resolved. Reason: Missing Constraint: Bundle-  RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,J2SE-1.4
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
    at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.osgi 4 0 2016-03-18 10:50:26.964
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.core.runtime_3.8.0.v20120912-155025.jar was not resolved.

!ENTRY org.eclipse.osgi 4 0 2016-03-18 10:50:26.965
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.equinox.common_3.6.100.v20120522-1841.jar was not resolved.

!ENTRY org.eclipse.osgi 4 0 2016-03-18 10:50:26.968
!MESSAGE Could not start bundle: org.eclipse.equinox.console
!STACK 0
org.osgi.framework.BundleException: Could not start bundle: org.eclipse.equinox.console
    at org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:217)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:297)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:520)
    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 bundle "org.eclipse.equinox.console_1.0.0.v20120522-1841 [84]" could not be resolved. Reason: Missing Constraint: Bundle-    RequiredExecutionEnvironment: J2SE-1.5
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
    at org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:215)
    ... 9 more
Root exception:
org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.console_1.0.0.v20120522-1841 [84]" could not be resolved. Reason: Missing Constraint: Bundle-   RequiredExecutionEnvironment: J2SE-1.5
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
    at org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:215)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:297)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:520)
    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)

我在 Mac OSX 10.9.5 上運行 Java 7:

$ java -version
  java version "1.7.0_71"

我發現了這個並且它有效: https : //gist.github.com/sshnakamoto/074b5428a25b467e4402d97ded02be9d

  1. 運行命令:

/usr/libexec/java_home -V結果應如下所示:

 9.0.4, x86_64: "Java SE 9.0.4" /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home 1.8.0_144, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
  1. 如果您在結果中看到 Java 9,請禁用:

首先導航到/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/然后重命名Info.plist -> Info.disabled.plist

  1. 驗證 Java 9 是否已禁用:

重新運行/usr/libexec/java_home -V ,您應該不再看到列出的 Java 9 版本

對我來說,有一個 Java 11。

我通過刪除 Java 9 並安裝 Java 8 使其工作

在 Mac 上我運行了這個

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane sudo rm -rf /Library/Internet\\ Plug-Ins/JavaAppletPlugin.plugin

然后安裝Java 8

brew cask 安裝 caskroom/versions/java8

我設法通過編輯重新啟動 Android Monitor(作為 VisualStudio for Mac 的一部分):

<user's>/Library/Developer/Xamarin/android-sdk-macosx/tools/lib/monitor-x86_64/monitor.app/Contents/Info.plist

並取消注釋該行下的其中一行:

> to use a specific Java version (instead of the platform's default)
> uncomment one of the following options

並添加了一行,其中包含機器上舊 JDK/JRE 版本的路徑。 就我而言,JDK 1.8。 看起來像:

<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java</string>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM