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

前端 未结 12 1550
不思量自难忘°
不思量自难忘° 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:57

    The libstdc++.so.6 is the cause (as pointed out by @doruMarinau); Android Studio 2.3 moved the file to a new folder your_sdk/emulator/lib64.

    If using Linux, create a symlink for it:

    $ ln -sf /usr/lib/libstdc++.so.6  /your_sdk/emulator/lib64/libstdc++/libstdc++.so.6
    
    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-14 07:58

    As of this release, the Android Emulator will be released separately from the SDK Tools. so just install android Emulator using sdk tools in your android studio

    0 讨论(0)
  • 2020-12-14 07:59

    The only solution which worked for me, was to install following missing libraries:

    $sudo apt-get install lib64stdc++6:i386
    $sudo apt-get install mesa-utils
    

    Once you have them, update the one there in sdk's emulator with these as following:

    $ ln -sf /usr/lib/libstdc++.so.6  /home/[YOUR_SYSTEM_USERNAME]/emulator/lib64/libstdc++/libstdc++.so.6
    

    Launch your emulator again and it will work just fine.

    0 讨论(0)
  • 2020-12-14 08:04

    Go to Sdk/emulator/lib64/libstdc++ move libstdc++.so.6 and libstdc++.so.6.0.18 to myfolder (I created this) (or any other location) as backup and copy libstdc++.so.6, libstdc++.so.6.0.21 from usr/lib64; try again to launch your virtual device.

    0 讨论(0)
  • 2020-12-14 08:05

    It’s a libGL error and libstdc++ issue. Cannot launch AVD in emulator. It’s a know bug and you can easily beat it with some simple steps.

    I have tested this solution on a Ubuntu 16.10 64bit

    Solution:

    $adb kill-server
    $adb start-server
    

    After this start your emulator from the Android studio. If this doesn't work then go ahead for the next solution.

    Alternative solution:

    First, install some packages and libs:

    $sudo apt-get install lib64stdc++6:i386
    $sudo apt-get install mesa-utils
    

    Second, tweak some links:

    $ cd YOURPATH/Android/Sdk/tools/lib64
    $ mv libstdc++/ libstdc++.bak
    $ ln -s /usr/lib64/libstdc++.so.6  libstdc++
    

    Third, relaunch your AVD device and test it.

    0 讨论(0)
提交回复
热议问题