android开发手动开启ddms调试工具失败java.lang.IllegalStateException: xxx的解决方法

发布时间 2023-07-28 15:47:04作者: yongfengnice
  1. Android studio3.1之后不再带有ddms调试工具了,不过如果我们想自己手动打开还是可以的。打开步骤如下:
    a. window下来自sdk安装目录tools目录下:D:\java\androidSdk\tools
    b. 可以看到有个monitor.bat文件,双击即可打开
    c. 如果是mac电脑的话类似,同样来到tools目录下有关monitor文件,打开即可。

  2. 双击monitor.bat文件,打开后报错,错误信息类似如下:
    java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
    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:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    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)

  3. 网上查了各种方法,最后解决,我也不知道具体哪种解决,下面记录一下我的解决方法:
    a. ddms工具只支持jdk1.8的不知道更高?我也不知道是不是真的,我那就想方法给他jdk1.8的吧。解决方法就是:来到D:\java\jdk1.8.0_351目录下将jre目录拷贝一份到D:\java\androidSdk\tools\lib\monitor-x86_64目录下。
    b. 但是还是提供问题的log,奇怪了,然后我搜索一下config.ini文件,发现xxx\monitor-x86_64\configuration下没有config.ini文件,但是xxx\monitor-x86\configuration下有config.ini文件,是不是64位的缺少config.ini文件??然后我就干脆拷贝一份xxx\monitor-x86\configuration下config.ini文件到xxx\monitor-x86_64\configuration下。
    c. 网上查的时候说有的说要使用管理员身份打开?最后我就干脆使用管理员身份打开试一下,结果就是使用管理员身份打开monitor.bat文件,居然打开成功了。不过很久没直接用ddms了,发现折腾了这么久好像没啥大用处,哈哈哈。