无法在AWS Linux上启动android仿真器

时间:2018-10-12 09:57:32

标签: linux amazon-web-services android-emulator qemu pulseaudio

无法在AWS linux上启动android模拟器.. 得到此异常:

  

“ android-sdk / emulator / qemu / linux-x86_64 / qemu-system-x86_64:错误   加载共享库时:libpulse.so.0:无法打开共享   目标文件:没有这样的文件或目录“

尝试安装pulseaudio软件包,但在aws linux中不可用...

  

$ sudo yum install pulseaudio加载的插件:优先级,update-motd,   upgrade-helper没有可用的软件包pulseaudio。错误:没事

完整日志:

[ec2-user@ip-**** emulator]$ emulator -list-avds
Nexus26
Nexus6P
Nexus_6_API_26
device25
[ec2-user@ip-**** emulator]$ emulator @Nexus26 -debug-all -debug-no-metrics
emulator:Android emulator version 26.0.3.0 (build_id 3965150)
emulator:Found AVD name 'Nexus26'
emulator:Found AVD target architecture: x86
emulator:argv[0]: 'emulator'; program directory: '/home/ec2-user/android-sdk/tools'
emulator:  Found directory: /home/ec2-user/android-sdk/system-images/android-26/default/x86/

emulator:Probing for /home/ec2-user/android-sdk/system-images/android-26/default/x86//kernel-ranchu: file exists
emulator:Auto-config: -engine qemu2 (based on configuration)
emulator:  Found directory: /home/ec2-user/android-sdk/system-images/android-26/default/x86/

emulator:try dir /home/ec2-user/android-sdk/tools
emulator:try dir .
emulator:Found target-specific 64-bit emulator binary: /home/ec2-user/android-sdk/emulator/./qemu/linux-x86_64/qemu-system-i386
emulator:Adding library search path: './lib64'
emulator:Adding library search path: './lib64/gles_swiftshader'
emulator:Adding library search path: './lib64/gles_angle'
emulator:Adding library search path: './lib64/gles_angle9'
emulator:Adding library search path: './lib64/gles_angle11'
emulator:Adding library search path: './lib64/libstdc++'
emulator: Adding library search path for Qt: './lib64/qt/lib'
emulator: Setting Qt plugin search path: QT_QPA_PLATFORM_PLUGIN_PATH=./lib64/qt/plugins
emulator: Running :/home/ec2-user/android-sdk/emulator/./qemu/linux-x86_64/qemu-system-i386
emulator: qemu backend: argv[00] = "/home/ec2-user/android-sdk/emulator/./qemu/linux-x86_64/qemu-system-i386"
emulator: qemu backend: argv[01] = "@Nexus26"
emulator: qemu backend: argv[02] = "-debug-all"
emulator: qemu backend: argv[03] = "-debug-no-metrics"
emulator: Concatenated backend parameters:
 /home/ec2-user/android-sdk/emulator/./qemu/linux-x86_64/qemu-system-i386 @Nexus26 -debug-all -debug-no-metrics
/home/ec2-user/android-sdk/emulator/./qemu/linux-x86_64/qemu-system-i386: error while loading shared libraries: libpulse.so.0: cannot open shared object file: No such file or directory

任何建议如何解决这个问题?

2 个答案:

答案 0 :(得分:0)

您使用的是Amazon Linux 1还是Amazon Linux 2?

Amazon Linux AMI中默认启用的软件包是有限的,但是您可以通过启用epel存储库来扩展可以安装的软件包:

# Amazon Linux 2
sudo amazon-linux-extras install epel
sudo yum install -y pulseaudio-libs

# Amazon Linux 1
sudo yum-config-manager --enable epel
sudo yum install -y pulseaudio pulseaudio-libs

更多信息可以在下面找到:

https://aws.amazon.com/premiumsupport/knowledge-center/ec2-enable-epel/

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-ami-basics.html#extras-library

答案 1 :(得分:0)

对于Ubuntu,则为i386软件包:

sudo apt-get install libpulse0:i386

对于CentOS,这将是i686软件包:

sudo yum-config-manager --enable epel
sudo yum install pulseaudio-libs.i686

这些通常甚至可以从base CentOS存储库中获得...

但可能已在/etc/yum.repos.d/配置中列入黑名单

甚至完全不在amzn-main存储库中。