8

I have opened it as an administrator and I don't want to install anything unnecessary. When I tried to open Android Device Monitor through Android Studio: Tools > Android > Android Device Monitor. It always shows the following screen shot: Screen shot that shows "An error has occurred" I have found solutions for windows, but I did not find solutions for mac.

One piece from the log:

!ENTRY org.eclipse.osgi 4 0 2015-12-02 22:52:40.714
!MESSAGE Bundle reference:file:org.apache.lucene.core_2.9.1.v201101211721.jar@4 not found.

There are lots of similar lines like this showing "something not found".

So what is missing? How do I install the exact missing parts? Thanks! (There is no enough space for me to install everything from android studio.)

Anoop M Maddasseri
  • 10,213
  • 3
  • 52
  • 73
RYAN
  • 155
  • 1
  • 2
  • 6

4 Answers4

10

First of all update Android SDK Tools from SDK Manager

  • Open a terminal window
  • Navigate to your SDK
  • Locate the 'tools' folder
  • cd into it
  • run: sudo ./monitor
  • Type in your password

Hope it might solve your problem.

Arth Tilva
  • 2,496
  • 22
  • 40
  • Thank you! This works. But I still cannot open it through Android Studio: Tools > Android > Android Device Monitor. What should I do? – RYAN Dec 04 '15 at 23:16
  • It might be bug in installation of Android Studio or something else, could not get perfect reason. – Arth Tilva Dec 05 '15 at 06:08
  • 1
    when i run sudo ./monitor i got this error message : 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) – JPCS May 02 '17 at 19:10
  • 1
    It seems that the problem was the java version since I had the 6 when I needed the 8 attachment link that helped me to update it The first one indicated the problem and the second like updating the java http://stackoverflow.com/questions/42661578/android-device-monitor-will-not-launch-either-from-android-studio-or-from-termi http://stackoverflow.com/questions/24342886/how-to-install-java-8-on-mac – JPCS May 02 '17 at 19:37
  • /Users/{username}/Library/Android/sdk/tools – Dmyan Feb 19 '18 at 13:31
  • 2
    It doesn't work for me. ./monitor: line 33: bin/archquery: No such file or directory ./monitor: line 41: /Users/leo/Library/Android/sdk/tools/lib/monitor-/monitor.app/Contents/MacOS/monitor: No such file or directory – Leo Nguyen Jul 25 '18 at 09:05
6

JPCS's solution worked for me; install Java 8 and then the Android Device Monitor will work:

First install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then update and install Java 8

$ brew update
$ brew cask install java
ferencvandervelde
  • 161
  • 1
  • 2
  • 7
  • In case you need to update your Product Structure JDK location, you can either run `echo $(/usr/libexec/java_home)` in the terminal, or just copy in `/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home` (which will be the location of JDK until the version changes, heh) – Mr. T Jul 31 '17 at 23:33
1

I followed some steps and after long hours struggle all things got sort it out and i got success to run device moniter on Mac OS x.

what i did ?

  • I installed Homebrew and used its some commands to install java , because its so easy to download and install java in terminal using home-brew. its very good tool to sort out java problems automatically . but here one thing is to keep in mind . which is below ->
  • when you install java using Homebrew then please make sure you are using same version of java and jre with android studio.in my case my android studio using jre_1.8.0 , so installed java8.

Their some steps to follow. just paste in terminal to download Homebrew to your system.

1.) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2.) $ brew tap caskroom/versions $ brew cask install java8.

this will download and install java 8 automatically to your mac OSx.i installed java 8 for my case,java 9 is also available but i used java8. because i added jre 8 in my android studio compile path.so its required both in same version to aviod conflict.

3.) so once its installed, just restart your android studio and run device moniter from android studio.now you android studio will able to launch device moniter without any conflict.

Thank Happy coding :)

Ramkesh Yadav
  • 987
  • 2
  • 11
  • 16
  • This might have worked at the time, but if you run `brew cask install java8`, it will install version 162, which doesn't work. You need to install 151 (Java SE Development Kit 8u151), link: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html?printOnly=1, ensure you don't have any other versions of Java, just in case. Versions 152, 161, and 162 don't seem to work. I'm running macOS High Sierra Version 10.13.2 – jameswoo Mar 13 '18 at 21:06
0

I had the same issue! Since I am not comfortable with using terminal, I just tried updating to the latest Java JDK and it seemed to fix the problem

etnie1031
  • 63
  • 7