3

I'm experiencing a problem with the Android Emulator: when I try to run an emulated device with an Android API version 22 or lower (Lollipop or older), the Emulator doesn't show up and on Android Studio the message "waiting target device to come online" stands still.

I had the same problem previously with all the devices emulated, but from when I switched the graphics rendering to "software" instead of "automatic", the problem doesn't show up on the emulated devices with Android API 23 or more (Marshmallow or newer) but is still there for all the emulated devices with Android API 22 or less (Lollipop or older).

I tried with many devices and API emulation

  • Nexus 5 API 25 (works)
  • Nexus 5 API 24 (works)
  • Nexus 5 API 23 (works)
  • Nexus 5 API 22 (doesn't work)
  • Nexus 5 API 21 (doesn't work)
  • Nexus 4 API 22 (doesn't work)
  • Nexus One API 22 (doesn't work)
  • Pixel API 25 (works)
  • Pixel API 24 (works)
  • Pixel API 23 (works)

I'm running Android Studio 2.3.1 on Ubuntu 16.10.

I've already made many attempt trying some possible solutions, suggested both here on Stack Overflow and also elsewhere, like:

  • Switching graphics rendering from "automatics" to "software" (it works, but just for emulations with Android versions >= 6.0 );
  • Going in Settings -> Appearance and Behavior -> System settings -> Android SDK -> SDK tools -> to see if the "Android Emulator was already checked" (and yes, is checked);
  • Check if I have dockers opened and eventually close them;
  • Deleted all the emulators and re-created;
  • Reboot the PC many times.

Nothing seems to do the job until now.

Are there possible solutions or people that already had this problem?

Thanks in Advance, Alessandro

Update - 24/07/2017
One week ago, I've updated the Android Emulator to the 26.1.2 version and since there, all the emulated devices needs to be started from command line (in other words, the GUI commands for starting emulated devices doesn't work for any device no more).
The situation has got worse, considering that this way I'm unable to use the terminal in Android Studio.
If I have other updates, I will write them here.

anatol
  • 791
  • 9
  • 16
  • Have you tried updating AS to the 2.3.3 to see if something changes? Which version of the Android Emulator you have in the SDK Tools? – MatPag Jun 19 '17 at 10:29
  • Android Studio 2.3.3 Build #AI-162.4069837, built on June 6, 2017 JRE: 1.8.0_112-release-b06 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o I updated Android Studio just now (with sudo chmod -R 777 [android studio folder]) to 2.3.3, but the issue is still here. – Alessandro Iudicone Jun 19 '17 at 12:29
  • Check the Android Emulator version in the SDK Tools panel inside the SDK Manager in AS – MatPag Jun 19 '17 at 12:43
  • Android Emulator Version is currently the "26.0.3" version. Sorry for the previous message, it gone a little "messed up" in terms of spacing. – Alessandro Iudicone Jun 19 '17 at 13:19
  • The latest version is 26.1.1, but at this point i think this shouldn't be the problem. Have you tried to update your graphic drivers? Maybe a problem with the OpenGL... – MatPag Jun 19 '17 at 13:26
  • If I run the command "**glxinfo | grep "OpenGL version"**" to check which version of OpenGL I have installed, i get as result "**OpenGL version string: 3.0 Mesa 12.0.6**" – Alessandro Iudicone Jun 19 '17 at 14:03
  • Have you tried [this](https://stackoverflow.com/a/22712342/2910520) or launching the emulator from the command line? – MatPag Jun 19 '17 at 14:07
  • You suggested me a possible solution for the "Eclipse" IDE but, as I mentioned in the original post, I'm using the "Android Studio" IDE so is not useful in my case; then about the command line, it seems that these functionalities are now deprecated and replaced by the Android Studio IDE, as reported on the following developer.android.com page "https://developer.android.com/studio/tools/help/android.html" Thanks anyway. – Alessandro Iudicone Jun 19 '17 at 14:50
  • 1) In the answer i linked, you could ignore the Eclipse parts, because they are not fundamental. 2) The deprecated command is `android` which has been replaced by `emulator` as stated [here](https://developer.android.com/studio/run/emulator-commandline.html) – MatPag Jun 19 '17 at 14:59
  • Sorry, my fault. I followed along your suggested steps: I done everything in the first part (except Eclipse) and nothing worked. I then tried to start the Emulator from command line and it worked ! The emulator runs smooth with all API I want to...also, it seems to run faster compared to the one that starts from AS. Beside, trying to start the Emulator from AS with API 21 or 22 still don't work. I don't know why, and I don't know if can handle the emulator from command line feeding him with the .APK to test, also because I don't know how to do debug this way. It is possible? Thanks again :) – Alessandro Iudicone Jun 19 '17 at 17:51
  • Once you have started the emulator with the command line, you can bind it to AS. Try to run your app and AS should find the running emulator and proposing it as the device where launch/debug your app – MatPag Jun 19 '17 at 18:00
  • Ok, it runs perfectly using software rendering, going in "~/Android/Sdk/emulator" and then running, for example, "./emulator -avd Nexus_5_API_22 -gpu swiftshader"; then yes, is possible to bind the emulator started this way with the command-line with the Android Studio connected devices. Can you please give me a suggestion for what to do with this post? Should I answer my question with the solution we found? Should I delete because there is another post with this solution (but maybe not the same problem)? Or is better that you reply with the solution found ? – Alessandro Iudicone Jun 20 '17 at 10:27
  • 1
    We found a workaround, not a definitive solution. If you want dig more on this you can try [this answer](https://stackoverflow.com/a/16532713/2910520) too. Don't delete the question because it could be helpfull to someone else. I don't want to add an answer here if we didn't find a real solution – MatPag Jun 20 '17 at 10:52

0 Answers0