单击 Android 设备监视器时出现 Android Studio 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26396201/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android Studio error when clicking on Android device monitor
提问by kintaro
I am having this error in android studio whenever i click on Android Device Monitor:
每当我单击 Android 设备监视器时,我都会在 android studio 中遇到此错误:
---------------------------
Monitor
---------------------------
An error has occurred. See the log file
C:\Users\<user>\AppData\Local\Android\android-studio\sdk\tools\lib\monitor-x86_64\configuration13432754457.log.
---------------------------
Aceptar
---------------------------
And the log file contains this:
日志文件包含以下内容:
!SESSION 2014-10-15 23:12:34.229 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_67
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=es_CO
Command-line arguments: -os win32 -ws win32 -arch x86_64
!ENTRY org.eclipse.osgi 4 0 2014-10-15 23:12:34.641
!MESSAGE Application error
!STACK 1
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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Please help me, It doesn't open SDK Manager, Device Monitor and AVD Manager.
请帮帮我,它没有打开 SDK 管理器、设备监视器和 AVD 管理器。
回答by Mohammad Yaseen
I am adding this answer because I think this will be helpful to future visitors.
我添加这个答案是因为我认为这对未来的访问者有帮助。
I ran into the same problem, and managed to solve it. However, My solution is different from the one already mentioned.
我遇到了同样的问题,并设法解决了它。但是,我的解决方案与已经提到的不同。
First of all, the monitor.inifile is in C:\Users\\AppData\Local\Android\sdk\tools\lib\monitor-x86_64and config.inifile is in ./configurationfolder
首先,monitor.ini文件在C:\Users\\AppData\Local\Android\sdk\tools\lib\monitor-x86_64,config.ini文件在./configuration文件夹
When I checked log file it said (at the very end of file) :
当我检查日志文件时,它说(在文件的最后):
java.io.IOException: The folder "C:\Users\.android\monitor-workspace.metadata" is read-only.
java.io.IOException:文件夹“C:\Users\.android\monitor-workspace.metadata”是只读的。
So I ran the monitor.exe
as Administratorand it worked fine.
所以我monitor.exe
以管理员身份运行,它运行良好。
Next I ran Android Studio as Admin and the ADM button worked fine.
接下来我以管理员身份运行 Android Studio,ADM 按钮工作正常。
回答by Haresh Chhelana
The config.inifile should specify org.eclipse.core.runtime@startin the osgi.bundles property. Here is the default osgi.bundles property, maybe it was (accidentally) changed during an upgrade:
在的config.ini文件应指定org.eclipse.core.runtime@start在osgi.bundles财产。这是默认的 osgi.bundles 属性,可能在升级过程中(意外)更改了:
You need to add the following line to the bottom of the eclipse.inimonitor.iniwhich is a configuration setting file located in your android-sdk\tools\lib\monitor-x86_64\ folder:
您需要将以下行添加到位于 android-sdk\tools\lib\monitor-x86_64\ 文件夹中的配置设置文件eclipse.ini monitor.ini的底部:
-Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start
After that, run Android Device Monitor from the same folder where you have made changes instead from Android Studio and right click on monitorwith eclipse icon>Run As Administrator
之后,从您进行更改的同一文件夹中运行 Android Device Monitor 而不是从 Android Studio 并右键单击带有 Eclipse 图标的监视器> 以管理员身份运行
Ref :"Unable to acquire application service" error while launching Eclipse
回答by Qamar
Error log file saying ".android\monitor-workspace\.metadata" is read-only unable to acquire application service.
After the error I saw the folder created by Android studio is called C:\Users\FirstName%20LastName\.android\monitor-workspace\.metadata
The space in the user folder name is a problem.
错误日志文件说".android\monitor-workspace\.metadata" is read-only unable to acquire application service.
错误后我看到Android studio创建的文件夹被称为C:\Users\FirstName%20LastName\.android\monitor-workspace\.metadata
用户文件夹名称中的空格有问题。
Make new user account and copy .android
and .AndroidStudio2.0
folder to the new user folder. Start Android Studio without "Run as Administrator".
使新的用户帐户,并复制.android
和.AndroidStudio2.0
文件夹复制到新的用户文件夹。在没有“以管理员身份运行”的情况下启动 Android Studio。
回答by Mifreitas10
Insert into search bar "monitor.exe" click up with the right mouse button and run as administrator.
在搜索栏中插入“monitor.exe”,用鼠标右键单击并以管理员身份运行。
回答by anand krish
The same eclipse.inifile will be located in Eclipse in this root path of eclipse itself like:
相同的eclipse.ini文件将位于 Eclipse 中 eclipse 本身的这个根路径中,例如:
C:\Users\username\Downloads\adt-bundle-windows-x86_64-20140702\eclipse\eclipse.ini
The same file will be located in android studio project:-
C:\Users\username\AppData\Local\Android\sdk\tools\lib\monitor-x86_64\monitor(Type:Configuration settings)
Edit the file as you want.
回答by AMD
\android-sdks\tools\lib\monitor-x86_64\configuration\org.eclipse.osgi.manager
\android-sdks\tools\lib\monitor-x86_64\configuration\org.eclipse.osgi.manager
There exist .fileTableLock--> uncheck Read-only from properies
存在.fileTableLock--> 从属性中取消选中只读
回答by Andrei Vinogradov
I had the same error. For me the reason was in JDK version. Non of JDK7 or JDK9 worked for me. But after installing JDK8 ADM stared normally.
我有同样的错误。对我来说,原因是在 JDK 版本中。非 JDK7 或 JDK9 对我有用。但是安装JDK8后ADM正常启动。