Reference link:
1. Click to open the link (but because it is an old answer, the modification method has changed)
1. The error is as follows (check the event log):
下午8:51 Emulator: libGL error: unable to load driver: nouveau_dri.so 8:51 PM Emulator: libGL error: driver pointer missing 下午8:51 Emulator: libGL error: failed to load driver: nouveau 下午8:51 Emulator: libGL error: unable to load driver: swrast_dri.so 下午8:51 Emulator: libGL error: failed to load driver: swrast 下午8:51 Emulator: X Error of failed request: BadValue (integer parameter out of range for operation) 下午8:51 Emulator: Major opcode of failed request: 155 (GLX) 下午8:51 Emulator: Minor opcode of failed request: 24 (X_GLXCreateNewContext) 下午8:51 Emulator: Value in failed request: 0x0 下午8:51 Emulator: Serial number of failed request: 58 下午8:51 Emulator: Current serial number in output stream: 59 下午8:51 Emulator: emulator: ERROR: Missing initial data partition file: /home/jiatai/.android/avd/Pixel_2_XL_API_27.avd/userdata.img 下午8:51 Emulator: Process finished with exit code 1
2. Android studio version and Ubuntu version
android studio version:
Ubuntu version book:
jiatai@jiatai:~/Android/Sdk/emulator/lib64/libstdc++$ uname -a Linux jiatai 4.13.0-37-generic #42~16.04.1-Ubuntu SMP Wed Mar 7 16:03:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
3. Solution:
Use the libstdc++.so.6 that comes with the computer instead of the one that comes with the sdk
jiatai@jiatai:~/Android/Sdk/emulator/lib64/libstdc++$ sudo apt-get install lib64stdc++6 jiatai@jiatai:~/Android/Sdk$ find -iname libstdc++.*.* ./emulator/lib/libstdc++/libstdc++.so.6.0.19 ./emulator/lib/libstdc++/libstdc++.so.6 ./emulator/lib64/libstdc++/libstdc++.so.6.0.19 ./emulator/lib64/libstdc++/libstdc++.so.6 jiatai@jiatai:~/Android/Sdk$ cd ./emulator/lib64/libstdc++/ jiatai@jiatai:~/Android/Sdk/emulator/lib64/libstdc++$ mv libstdc++.so.6 libstdc++.so.6.bak jiatai@jiatai:~/Android/Sdk/emulator/lib64/libstdc++$ ls libstdc++.so.6.0.19 libstdc++.so.6.bak jiatai@jiatai:~/Android/Sdk/emulator/lib64/libstdc++$ ln -s /usr/lib64/libstdc++.so.6
4. Flashback after opening the emulator
log:
Process finished with exit code 139
The following steps did the trick for me.
- Go into your virtual device's settings.
- Chang "Emulated Performance" from "Automatic" to "Software".