26

Using Android Studio 2.3 and Ubuntu 16.10 the emulator did not start. Message: waiting emulator come on line. How can I configure to emulator start?

Gustavomcls
  • 1,655
  • 2
  • 12
  • 20

6 Answers6

105

Source: https://cialu.net/solve-android-studio-avd-issue-with-ubuntu-16-10/

sudo apt-get install lib64stdc++6:i386

sudo apt-get install mesa-utils

(look for the path of the sdk)

cd YOURPATH/Android/Sdk/emulator/lib64

mv libstdc++/ libstdc++.bak

ln -s /usr/lib64/libstdc++.so.6 libstdc++

Finally, run your application again using emulator.

Yonjuni
  • 178
  • 2
  • 12
Gustavomcls
  • 1,655
  • 2
  • 12
  • 20
  • The link is broken, maybe the correct new link is https://cialu.net/solve-android-studio-avd-issue-with-ubuntu-16-10/, proposed by [Manu](http://stackoverflow.com/users/5325047/manu) in this [Answer](http://stackoverflow.com/a/43580902/5292302), check and if you edit post flag this comment as obsolete – Petter Friberg Apr 24 '17 at 06:36
  • New link changed. Thanks! – Gustavomcls Apr 28 '17 at 11:51
  • Hi i dint have lib64 in tools folder – Jinu Jun 29 '17 at 02:16
  • My folder was `YOURPATH/Android/Sdk/tools/lib64` – Morgoth Jul 03 '17 at 16:34
  • See [this SO answer](https://stackoverflow.com/questions/36668957/regarding-gpu-mode-error-in-launching-android-virtual-device) for help on Ubuntu 16.04 and the error message `ERROR: Invalid GPU mode 'mesa', use one of: on off host guest` – phoenix Jul 20 '17 at 13:21
  • This solution doesn´t seem to work on Ubuntu 18 / Android 3.1. There is no such a file in that directory; the file I found is libc++.so.1 and if I replace it I get the following error: "KVM is required to run this AVD. Unknown Error" when trying to run the AVD. – Caio Mar Jul 11 '18 at 15:24
23

Instead of making changes to APT-managed system libraries (eek!), you can just add the following at the top of your bin/studio.sh file:

# Preload shared library required by Android emulator
export LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libstdc++.so.6'

Tested on Ubuntu 16.10 with Android Studio 2.3.3.

Jason McVetta
  • 1,383
  • 11
  • 11
  • Recently decided to give new Ubuntu a try on a laptop I had laying around after a few years as Mac only (many years of Linux before this), and I see that they now use `snap` for their apps, or at least for Android Studio. `snap` works like `Docker` for the app, mounting it in a read-only file system then running it container-style. As a result, you cannot modify the startup script if you use `snap`, at least not easily, and it looks like this will be the state of the future. – TrivialCase May 10 '18 at 19:33
8

Just before following above commands make sure you did download the emulator first.enter image description here

Prashant Abdare
  • 2,175
  • 14
  • 24
1

For me, what worked was to add

export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1

in my .profile and it worked without doing anything more.

csotiriou
  • 5,653
  • 5
  • 36
  • 45
0

You can always try to kill the adb server first before starting it up again. It solves the problem most of the time! Terminal commands:

adb kill-server
adb start-server
Michael Troger
  • 3,336
  • 2
  • 25
  • 41
0

For me what worked was- 1- Select all x86 images in the respective phone model. Go to "show package details" option and enusre the x86 image options are selected for the respective chosen model. 2- Also make sure no other applications are open at the backend not even the browser. Because even that is leading to hang may be due to the configuration of the system that I have.