Emulator on Android Studio doesn't start after SDK tools update to 25.3.1

前端 未结 12 1563
不思量自难忘°
不思量自难忘° 2020-12-14 07:41

After updating my Android SDK tools today to 25.3.1, the emulator won\'t run anymore.

I can open the AVD Manager. When I hit \"Play\" on one of the emulators on the

12条回答
  •  我在风中等你
    2020-12-14 07:58

    The real problem, at least over Ubuntu 16.10 and 17.04 and Andoid Studio 2.4 Preview 7 (but could happen with any Debian derivative and previous versions of Android Studio), is that Google is distributing a non working libstdc++ library with the emulator tools. They're distributing 6.0.18 version, but i found that the working one is 6.0.22.

    EDIT: There are reports that 6.0.21 version of libstdc++ works as well as 6.0.22.

    So, you have 2 options:

    Option 1

    rm the previous non working Google's libs in /yoursdkpàth/emulator/lib64/libstdc++

    Download and extract libs from libstdc++ official package in /yoursdkpàth/emulator/lib64/libstdc++

    Don't try to install the .deb, extract the files/binaries from inside it (the 2 binaries are in a folder named "lib") and manuallly copy them on the recommended path.

    Option 2

    Create a simlink to the lib distributed with Ubuntu, which already is 6.0.22 version

    cd ~/Android/Sdk/emulator/lib64/libstdc++/
    
    mv libstdc++.so.6 libstdc++.so.6.bak
    
    mv libstdc++.so.6.0.18 libstdc++.so.6.0.18.bak
    
    ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ~/Android/Sdk/emulator/lib64/libstdc++/libstdc++.so.6
    
    ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 ~/Android/Sdk/emulator/lib64/libstdc++/libstdc++.so.6.0.22
    

    IMPORTANT 1: As Google seems to be not aware of the problem, on every update they make to the Android Emulator package in Android Studio, they break the funcionality replacing your working SDK C++ libs with the broken/older ones. The solution is to repeat any of the above procedures.

    IMPORTANT 2: This is only valid if your AVDs are configured for use your PC GPU as host for video accelaration (Hardware GLES 2.0). Selecting Sofware GLES 2.0 on your AVD will work without any of the suggested changes, but your emulator will turn painfully slow.

提交回复
热议问题