androidemulationubuntu-17.04

Android emulator won't launch on Ubuntu 17.04


I've downloaded Android Studio 2.3.3 and currently, I'm trying to run basic Hello World activity which is automatically generated. When I try to launch emulator, it does not launch.

Is it a known bug or just wrong configuration? I was also surprised that there is just version 2.3.3 for Linux.


Solution

  • The emulator comes with a bundled libstdc++.so file. In some cases the bundled file is not compatible with your system. Using the libstdc++.so.6 that is available in your system instead of the one bundled with the Android SDK may solve this issue.

    To use the system's libstdc++.so file, edit the .profile file, located in your home folder, and append this at the end of the file:

    export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
    

    From the documentation of Android Studio Environment Variables reference:

    Contains a value of 0 (default) or 1. A value of 1 means to use the system's libstdc++.so file instead of the one that comes bundled with the emulator. Set this environment variable only when the emulator does not start on your Linux system because of a system library problem. For example, some Linux Radeon GL driver libraries require a more recent libstdc++.so file.

    Note:

    There is no guarantee that setting this environment variable to 1 will make the emulator runnable. It is a work-around for system library issues that affect a very small number of Linux users.