Android Studio Run Emulator Failed on linux

余生颓废 提交于 2019-12-10 10:54:28

问题


I'm tried to run the Android Emulator from Android Studio 2.3.3 (On linux machine) but if fails with no error (I try with a x86 image API 24).

So I try to run from console

 /opt/android/android-sdk-linux/tools/emulator @Nexus_5_API_24 

and I get this error

libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext

I found out here that running with -use-system-libs option solves the problem

My question is how can I add this parameter to run the emulator via Android Studio? How can I start my app from Android Studio on the emulator that I run from terminal? Now I recieved this error:

com.android.ddmlib.AdbCommandRejectedException: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
Error while Installing APK

回答1:


Problem cause of Android-Studio Driver which is shipped with the Software. Do this to replace it by the os-driver (for me on Manjaro-Linux [kind of Arch-Linux]:

mv ~/Android/Sdk/emulator/lib64/libstdc++/libstdc++.so.6{,.bak}
mv ~/Android/Sdk/emulator/lib64/libstdc++/libstdc++.so.6.0.18{,.bak}
ln -s /usr/lib/libstdc++.so  ~/Android/Sdk/emulator/lib64/libstdc++/

For older Android-Studio versions, the libstdc++ lay in another directory (named tools instead emulator). For this use:

mv ~/Android/Sdk/tools/lib64/libstdc++/libstdc++.so.6{,.bak}
mv ~/Android/Sdk/tools/lib64/libstdc++/libstdc++.so.6.0.18{,.bak}
ln -s /usr/lib/libstdc++.so  ~/Android/Sdk/tools/lib64/libstdc++/


来源:https://stackoverflow.com/questions/44908238/android-studio-run-emulator-failed-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!