Linux上的Android Studio运行模拟器失败 [英] Android Studio Run Emulator Failed on linux
问题描述
我试图从Android Studio 2.3.3(在Linux计算机上)运行Android模拟器,但是如果失败且没有错误(我尝试使用x86图像API 24).
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
我得到这个错误
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
我发现此处使用-use-system-libs
选项运行可以解决问题
I found out here that running with -use-system-libs
option solves the problem
我的问题是如何添加此参数以通过Android Studio运行模拟器? 如何在终端上运行的模拟器上从Android Studio启动应用程序? 现在,我收到此错误:
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
推荐答案
软件随附的Android Studio驱动程序的问题原因. 这样做可以用os驱动程序代替它(对我来说,在Manjaro-Linux [Arch-Linux上是这样的:
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++/
对于较旧的Android-Studio版本,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++/
这篇关于Linux上的Android Studio运行模拟器失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!