5

When I open Android Device monitor, I am getting the following error:

An error has occurred. See the log file
/home/omkar/Android/Sdk/tools/lib/monitor-x86_64/configuration/1509852867579.log.

I have already tried:

  1. Running Android studio with "sudo"/ root user permission.
  2. Reinstalling Android SDK.

My configuration :

  1. Android Studio 3.0
  2. Android SDK API version 27.
  3. Ubuntu 17.10 Gnome

I am attaching the pastebin link for the logs in the question. Logs Link : https://pastebin.com/cje8fkgY

Omkar Nath Singh
  • 3,375
  • 2
  • 15
  • 34

2 Answers2

8

While Android Studio brings its own Java version with it, the (now mostly deprecated) Android Device Monitor (ADM) is dependent on the Java version installed on your machine. From other error reports around the web, it seems that ADM needs Java 8 (here, for example). This is also where our machines differ from each other. As I noted in a comment above, I am, too, on Ubuntu 17.10, Android Sdk 27 and Android Studio 3.0, however, I have Java 8 installed, and ADM runs fine.

Therefore I would suggest you to add Java 8 to your machine and make it the default version. On Ubuntu, you can do this like that:

sudo add-apt-repository ppa:webupd8team/java // only necessary if repository not yet added
sudo apt-get update                          // only necessary if repository not yet added

sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
kalabalik
  • 3,792
  • 2
  • 21
  • 50
  • java 9 is now stable, why should I use a old version? ADM is not deprecated. Please answer correctly. Only thing is now logcat has been seperated from ADM in Studio view. The problem is with the ADM side not Java side. I have tried it with Java 8 also. – Omkar Nath Singh Nov 11 '17 at 13:17
  • "most components of the Android Device Monitor are deprecated" (https://developer.android.com/studio/profile/monitor.html) – kalabalik Nov 11 '17 at 13:40
  • How to open the new profiler then? Thats also not opening for me. – Omkar Nath Singh Nov 12 '17 at 08:06
0

You need to set the default Java version. To do this follow below steps:

Run:

sudo  update-java-alternatives --list

to list off all the Java installations on a machine by name and directory, and then run:

sudo  update-java-alternatives --set [JDK/JRE name e.g. java-1.8.0-openjdk-amd64]

This worked perfectly for me.

0xAliHn
  • 18,390
  • 23
  • 91
  • 111