【问题标题】:Android Device Monitor starting with error from intellij on MacAndroid 设备监视器从 Mac 上的 intellij 错误开始
【发布时间】:2014-12-11 03:49:03
【问题描述】:

当尝试在 Mac 上从 Intellij(或 Android Studio)启动 Android Device Monitor 时,结果是一个错误消息对话框告诉

Failed to create the Java Virtual Machine.

当调用 .../android-sdk-macosx/tools/monitor(实际上是从 intellij 中的菜单调用)时,错误消息变得更加具体

Error: could not find libjava.dylib
Failed to GetJREPath()

必须做些什么才能使监视器可以从 Intellij 中调用?

【问题讨论】:

    标签: android macos intellij-idea


    【解决方案1】:

    要解决这个问题,你必须做两件事:

    1. 查找或安装包含库 libjava.dylib 的 JRE/JDK,例如在 /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib
    2. 启用监视器应用程序以使用来自 JRE 的 Java,该 JRE 靠近来自 1 的库。)例如/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin

    要解决第一个问题,您可以安装 JRE,如 here 所述

    要解决第二个问题,您必须在文件 .../android-sdk-macosx/tools/lib/monitor-x86_64/monitor. app/Contents/Info.plist(适用于 64 位)

    喜欢

    <array>
            <string>-vm</string><string>/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java</string>
            <!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options:
                <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Commands/java</string>
                <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/java</string>
            -->
            <string>-keyring</string><string>~/.eclipse_keyring</string>
            <string>-showlocation</string>
            <!-- WARNING:
                If you try to add a single VM argument (-vmargs) here,
                *all* vmargs specified in eclipse.ini will be ignored.
                We recommend to add all arguments in eclipse.ini
             -->
    </array>
    

    然后监控应用程序应该能够创建 JVM 并运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-15
      • 2018-08-05
      • 1970-01-01
      • 1970-01-01
      • 2015-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多