简体   繁体   中英

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.

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.

Option -gpu swiftshader_indirect helps me in my case. Full command to start emulator

/android_sdk/tools/emulator @NEXUS_API_27 -verbose -no-boot-anim -gpu swiftshader_indirect

Where NEXUS_API_27 name of virtual device. You can get it here:

/android_sdk/tools/bin/avdmanager list avd

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM