【发布时间】:2018-01-05 01:31:32
【问题描述】:
在 Ubuntu 上运行 Android 模拟器似乎比 Windows 版本更复杂。我不再看到在 SDK 管理器中下载英特尔硬件辅助虚拟化软件的相同选项,而是根据How to Start Intel Hardware-assisted Virtualization (hypervisor) on Linux to Speed-up Intel Android x86 Emulator 链接指示我使用 KVM 运行它,这需要 Qt,但即使我安装了它我出现以下错误:
./emulator64-arm: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.7' not found (required by ./emulator64-arm)
./emulator64-arm: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by ./emulator64-arm)
./emulator64-arm: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: version `Qt_5' not found (required by ./emulator64-arm)
./emulator64-arm: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by ./emulator64-arm)
./emulator64-arm: /usr/lib/x86_64-linux-gnu/libQt5Svg.so.5: version `Qt_5' not found (required by ./emulator64-arm)
我尝试安装 qt 5.7 版。当我发出qmake -version 时,我看到QMake version 3.0
Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu
,所以我尝试使用程序here 在同一目录中安装新版本的qt,但安装程序只是挂起。但我可以在我的主文件夹中安装 qt;但是,这对我没有用,因为它不会更改系统配置,并且 qmake 仍然显示我拥有的旧版本的 qt。这是我机器上所有不同版本的 qt:
$ ls -al /usr/lib/x86_64-linux-gnu/qt*
/usr/lib/x86_64-linux-gnu/qt4:
total 116
drwxr-xr-x 4 root root 4096 Jul 19 2016 .
drwxr-xr-x 128 root root 102400 Jul 28 16:01 ..
drwxr-xr-x 2 root root 4096 Jul 19 2016 bin
drwxr-xr-x 16 root root 4096 Dec 1 2016 plugins
/usr/lib/x86_64-linux-gnu/qt5:
total 128
drwxr-xr-x 7 root root 4096 Jun 16 22:31 .
drwxr-xr-x 128 root root 102400 Jul 28 16:01 ..
drwxr-xr-x 2 root root 4096 May 16 15:30 bin
drwxr-xr-x 2 root root 4096 Jul 19 2016 libexec
drwxr-xr-x 97 root root 4096 May 16 15:30 mkspecs
drwxr-xr-x 17 root root 4096 Jun 16 22:31 plugins
drwxr-xr-x 11 root root 4096 Jul 19 2016 qml
/usr/lib/x86_64-linux-gnu/qt7:
total 108
drwxr-xr-x 2 root root 4096 Jul 26 17:25 .
drwxr-xr-x 128 root root 102400 Jul 28 16:01 ..
/usr/lib/x86_64-linux-gnu/qtchooser:
total 108
drwxr-xr-x 2 root root 4096 May 16 15:30 .
drwxr-xr-x 128 root root 102400 Jul 28 16:01 ..
lrwxrwxrwx 1 root root 50 Nov 7 2016 4.conf -> ../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 50 May 12 14:47 5.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 50 May 12 14:47 default.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 50 Nov 7 2016 qt4.conf -> ../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 50 May 12 14:47 qt5.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
/usr/lib/x86_64-linux-gnu/qt-default:
total 112
drwxr-xr-x 3 root root 4096 Jul 19 2016 .
drwxr-xr-x 128 root root 102400 Jul 28 16:01 ..
drwxr-xr-x 2 root root 4096 Jul 19 2016 qtchooser
我想知道是否有更好的方法来运行模拟器,因为我在 Ubuntu 上看到了有关 Genymotion 和许多其他 Android 虚拟化软件的 cmets,我下载了这些软件,但我不知道如何运行 avd 我使用 genymotion 在 SDK 文件夹中创建。取而代之的是一些图像,您可以从中选择。为了测试您的应用程序,在 Ubuntu 上运行 Android 模拟器的最佳方式是什么?
我看到this 链接,它建议使用以下命令:`LD_PRELOAD='/usr/$LIB/libstdc++.so.6' DISPLAY=:0 ./emulator -avd Nexus -qemu -m 2047 -enable- kvm
这似乎导致模拟器在我得到核心转储之前出现一秒钟,并且出现以下错误:
emulator: WARNING: Ignoring invalid http proxy: Empty proxy configuration string
*** Error in `/home/sansari/Android/Sdk/emulator/qemu/linux-x86_64/qemu-system-i386': double free or corruption (fasttop): 0x00007f82f0029670 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f83e7ed77e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f83e7ee037a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f83e7ee453c]
/usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so(+0x4a4db5)[0x7f83c5e61db5]
/usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so(+0x4a50a3)[0x7f83c5e620a3]
/usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so(+0x1de93d)[0x7f83c5b9b93d]
/usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so(+0x1de980)[0x7f83c5b9b980]
/home/sansari/Android/Sdk/emulator/lib64/lib64OpenglRender.so(+0x45e9a)[0x7f83d090de9a]
/home/sansari/Android/Sdk/emulator/lib64/lib64OpenglRender.so(+0x32f42)[0x7f83d08faf42]
/home/sansari/Android/Sdk/emulator/lib64/lib64OpenglRender.so(+0x646e)[0x7f83d08ce46e]
/home/sansari/Android/Sdk/emulator/lib64/lib64OpenglRender.so(+0x67884)[0x7f83d092f884]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f83ea46d6ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f83e7f673dd]
======= Memory map: ========
`
【问题讨论】:
标签: android android-studio android-emulator ubuntu-16.04 genymotion