Android SDK升级到O后在Linux下无法启动模拟器问题

Android开发工具的兼容性真的是越来越烂了。。

1、首先是无法创建虚拟机

sudo apt-get install lib32stdc++6

然后重启下Android Studio

2、创建好之后,点击启动虚拟机没有反映

怎么排查这个问题呢。首先AS肯定没有内置avd,只不过调用了sdk下的emulator

我们直接执行一下看看

./emulator64-x86 
./emulator64-x86: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.7' not found (required by ./emulator64-x86)
./emulator64-x86: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by ./emulator64-x86)
./emulator64-x86: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: version `Qt_5' not found (required by ./emulator64-x86)
./emulator64-x86: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by ./emulator64-x86)
./emulator64-x86: /usr/lib/x86_64-linux-gnu/libQt5Svg.so.5: version `Qt_5' not found (required by ./emulator64-x86)

坑爹了,系统的QT版本太低,好在SDK提供了备用的so,就在这里:emulator/lib64/qt/lib/

我们可以改一下bashrc

vim ~/.bashrc
# 添加
QT_STDCXX_PATH="$HOME/Android/Sdk/emulator/lib64/libstdc++"
QT_57_PATH="$HOME/Android/Sdk/emulator/lib64/qt/lib"
export LD_LIBRARY_PATH="$QT_STDCXX_PATH:$QT_57_PATH:$LD_LIBRARY_PATH"

然后重启系统,就可以了。

补充一句,as的系统log在:

$HOME/.AndroidStudio2.3/system/log/idea.log

 

Leave a Reply

Your email address will not be published. Required fields are marked *