无法在android studio 2.0中启动模拟器

时间:2020-12-16 18:56:36

I just upgraded my android studio from 1.5 to 2.0.And now I am facing some weird bug when I try to start Emulator. I use Ubuntu 15.10 OS

我刚刚把我的android studio从1.5升级到2.0。现在,当我尝试启动模拟器时,我遇到了一些奇怪的错误。我使用Ubuntu 15.10操作系统

Android monitor returns this message

Android monitor返回此消息

sh: 1: glxinfo: not found
sh: 1: glxinfo: not found
libGL error: unable to load driver: r600_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: r600
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range    for  operation)
Major opcode of failed request:  155 (GLX)
Minor opcode of failed request:  24 (X_GLXCreateNewContext)
Value in failed request:  0x0
Serial number of failed request:  33
Current serial number in output stream:  34
 QObject::~QObject: Timers cannot be stopped from another thread

When I was using 1.5 version all was going good. Is it a bug in android studio 2.0.

当我使用1.5版本时,一切都很好。它是android studio 2.0中的一个bug吗?

How to remove this error?

如何消除这个错误?

14 个解决方案

#1


194  

Verify that you have installed in your system lib64stdc++6

验证您已在系统lib64stdc+ 6中安装

With a 32 bits operating system :

使用32位操作系统:

# apt-get install lib64stdc++6

With a 64 bits operating system with multiarch enabled :

启用multiarch的64位操作系统:

# apt-get install lib64stdc++6:i386

Then link the new installed libraries to the android sdk tools path

然后将新安装的库链接到android sdk工具路径

$ cd $ANDROID_HOME/android-sdk-linux_x86/tools/lib64/libstdc++
$ mv libstdc++.so.6 libstdc++.so.6.bak
$ ln -s /usr/lib64/libstdc++.so.6 $ANDROID_HOME/android-sdk-linux_x86/tools/lib64/libstdc++

EDIT: in 15.10 x64 with current Sdk (23), the folder is $ANDROID_HOME/Sdk

编辑:在15.10 x64和当前Sdk(23)中,文件夹是$ANDROID_HOME/Sdk

#2


25  

Another solution for me was to use systems libraries:

我的另一个解决方案是使用系统库:

emulator -use-system-libs -avd YOUR_VIRTUAL_DEVICE_NAME

模拟器-use-system-libs avd YOUR_VIRTUAL_DEVICE_NAME

#3


22  

I had the same issue on an Arch Linux box. I had to do two things to solve all the issues:

我在Arch Linux盒子上也有同样的问题。我必须做两件事来解决所有的问题:

  1. Install mesa-demos. This is the Arch Linux package which contains glxinfo:

    安装mesa-demos。这是Arch Linux包,包含glxinfo:

    $ sudo pacman -S mesa-demos
    
  2. Run the emulator with the -use-system-libs flag:

    使用-use-system-libs标志运行模拟器:

    $ emulator -avd <AVD name> -use-system-libs
    

    To enable this behavior in Android Studio, I set the ANDROID_EMULATOR_USE_SYSTEM_LIBS enviornment variable in ~/.zshrc.

    为了在Android Studio中启用这种行为,我在~/.zshrc中设置了ANDROID_EMULATOR_USE_SYSTEM_LIBS环境变量。

    export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
    

    You can also set this in ~/.profile or ~/.bashrc. In all of these cases, you will have to start Android Studio from the command-line. Alternatively, you can set it in ~/.pam_environment to be able to start Android Studio from a desktop launcher:

    您还可以将其设置为~/。配置文件或~ / . bashrc。在所有这些情况下,您将不得不从命令行启动Android Studio。或者,您可以将它设置为~/。pam_environment可以从桌面启动器启动Android Studio:

    ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
    

#4


17  

After doing the two steps above, install mesa-utils if it is not installed.

完成以上两个步骤后,如果没有安装mesa-utils,请安装它。

$ sudo apt-get install mesa-utils

$ sudo apt-get install mesa-utils

#5


13  

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

it's worked for me

它为我工作

#6


9  

Same problem for me on Ubuntu 16.04 LTS x64 with :

我在Ubuntu 16.04 LTS x64上遇到了同样的问题:

  • Android Studio 2.2.3
  • Android工作室2.2.3
  • Android SDK Tools 25.2.4
  • Android SDK工具25.2.4
  • Emulator version 25.2.4-3534729 (From Emulator > Extended Controls > Help > About)
  • 仿真器版本25.2.4-3534729(来自仿真器>扩展控件>帮助>关于)

My graphic card is an AMD/ATI Radeon and I read from this thread on Android Open Source Project - Issue Tracker that :

我的图形卡是AMD/ATI Radeon,我从这个关于Android开源项目的线程中读到:

The root cause of the problem is likely that the Radeon GL driver library requires a more recent libstdc++.so than the one bundled with the emulator.

问题的根本原因很可能是Radeon GL驱动程序库需要一个最近的libstdc++。比和模拟器绑定的那个。

Here's how I fixed the problem :

我是这样解决这个问题的:

  1. Install lib64stdc++6

    安装lib64stdc + + 6

    $ sudo apt-get install lib64stdc++6:i386   
    
  2. Install mesa-demos

    安装mesa-demos

    $ sudo apt-get install mesa-utils
    
  3. Move libstdc++.so.6 out of the way by renaming it to libstdc++.so.6.bak

    移动libstdc + + . so。6.通过将其重命名为libstdc+ .so. bak来解决这个问题

    $ cd ~/$ANDROID_HOME/Android/Sdk/tools/lib64/libstdc++
    $ mv libstdc++.so.6 libstdc++.so.6.bak
    

#7


2  

after the update to build tools 25.3.1 libstdc++.so.6 file had been moved to $ANDROID_HOME/Sdk/emulator/lib64/libstdc++/libstdc++.so.6

在更新后构建工具25.3.1 libstdc+ .so。文件已被移动到$ANDROID_HOME/Sdk/模拟器/lib64/libstdc++/libstdc++. so6

#8


1  

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

Try it!

试一试!

#9


0  

In an extraordinary situation your KVM resources might be busy because of another running VirtualBox VMs.

在特殊情况下,由于另一个正在运行的虚拟机,KVM资源可能会很忙。

(I've experienced this issue).

(我经历过这个问题)。

To overcome this issue I used Genymotion instead of Android Emulator.

为了克服这个问题,我使用了Genymotion而不是Android模拟器。

Then I could run Genymotion together with other VirtualBox VMs.

然后我可以与其他虚拟机一起运行Genymotion。

#10


0  

Fix on Ubuntu 16 LTS

修复ubuntu16lts

1.Install lib64stdc++6

1。安装lib64stdc + + 6

sudo apt-get install lib64stdc++6:i386  

2.Install mesa-demos

2。安装mesa-demos

sudo apt-get install mesa-utils

#11


0  

sudo apt-get install mesa-utils

Ref: https://github.com/beidl/prime-indicator/issues/6

裁判:https://github.com/beidl/prime-indicator/issues/6

#12


0  

All of the above answers did not work for me as "Android Emulator" was not installed with standard installation of Android Studio. Make sure you have installed it and then try above answers. 无法在android studio 2.0中启动模拟器

以上答案对我都不起作用,因为“Android模拟器”并没有安装在Android Studio的标准安装中。确保你已经安装了它,然后尝试上面的答案。

#13


0  

I had the same problem and the solution didn't work for me.

我遇到了同样的问题,但解决方案对我不起作用。

The solution that work for me was telling to Android Studio that use the system libraries instead of the built-in by editing $HOME/.profile and adding the next line: export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1, and then re-log.

我的解决方案是告诉Android Studio使用系统库而不是通过编辑$HOME/来使用内置库。配置文件并添加下一行:导出ANDROID_EMULATOR_USE_SYSTEM_LIBS=1,然后重新记录。

#14


0  

Create a new AVD, or edit an existing one and change the Emulated Performance Graphics from Automatic to Software

创建一个新的AVD,或者编辑一个现有的AVD,并将模拟的性能图形从自动变为软件

无法在android studio 2.0中启动模拟器

#1


194  

Verify that you have installed in your system lib64stdc++6

验证您已在系统lib64stdc+ 6中安装

With a 32 bits operating system :

使用32位操作系统:

# apt-get install lib64stdc++6

With a 64 bits operating system with multiarch enabled :

启用multiarch的64位操作系统:

# apt-get install lib64stdc++6:i386

Then link the new installed libraries to the android sdk tools path

然后将新安装的库链接到android sdk工具路径

$ cd $ANDROID_HOME/android-sdk-linux_x86/tools/lib64/libstdc++
$ mv libstdc++.so.6 libstdc++.so.6.bak
$ ln -s /usr/lib64/libstdc++.so.6 $ANDROID_HOME/android-sdk-linux_x86/tools/lib64/libstdc++

EDIT: in 15.10 x64 with current Sdk (23), the folder is $ANDROID_HOME/Sdk

编辑:在15.10 x64和当前Sdk(23)中,文件夹是$ANDROID_HOME/Sdk

#2


25  

Another solution for me was to use systems libraries:

我的另一个解决方案是使用系统库:

emulator -use-system-libs -avd YOUR_VIRTUAL_DEVICE_NAME

模拟器-use-system-libs avd YOUR_VIRTUAL_DEVICE_NAME

#3


22  

I had the same issue on an Arch Linux box. I had to do two things to solve all the issues:

我在Arch Linux盒子上也有同样的问题。我必须做两件事来解决所有的问题:

  1. Install mesa-demos. This is the Arch Linux package which contains glxinfo:

    安装mesa-demos。这是Arch Linux包,包含glxinfo:

    $ sudo pacman -S mesa-demos
    
  2. Run the emulator with the -use-system-libs flag:

    使用-use-system-libs标志运行模拟器:

    $ emulator -avd <AVD name> -use-system-libs
    

    To enable this behavior in Android Studio, I set the ANDROID_EMULATOR_USE_SYSTEM_LIBS enviornment variable in ~/.zshrc.

    为了在Android Studio中启用这种行为,我在~/.zshrc中设置了ANDROID_EMULATOR_USE_SYSTEM_LIBS环境变量。

    export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
    

    You can also set this in ~/.profile or ~/.bashrc. In all of these cases, you will have to start Android Studio from the command-line. Alternatively, you can set it in ~/.pam_environment to be able to start Android Studio from a desktop launcher:

    您还可以将其设置为~/。配置文件或~ / . bashrc。在所有这些情况下,您将不得不从命令行启动Android Studio。或者,您可以将它设置为~/。pam_environment可以从桌面启动器启动Android Studio:

    ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
    

#4


17  

After doing the two steps above, install mesa-utils if it is not installed.

完成以上两个步骤后,如果没有安装mesa-utils,请安装它。

$ sudo apt-get install mesa-utils

$ sudo apt-get install mesa-utils

#5


13  

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

it's worked for me

它为我工作

#6


9  

Same problem for me on Ubuntu 16.04 LTS x64 with :

我在Ubuntu 16.04 LTS x64上遇到了同样的问题:

  • Android Studio 2.2.3
  • Android工作室2.2.3
  • Android SDK Tools 25.2.4
  • Android SDK工具25.2.4
  • Emulator version 25.2.4-3534729 (From Emulator > Extended Controls > Help > About)
  • 仿真器版本25.2.4-3534729(来自仿真器>扩展控件>帮助>关于)

My graphic card is an AMD/ATI Radeon and I read from this thread on Android Open Source Project - Issue Tracker that :

我的图形卡是AMD/ATI Radeon,我从这个关于Android开源项目的线程中读到:

The root cause of the problem is likely that the Radeon GL driver library requires a more recent libstdc++.so than the one bundled with the emulator.

问题的根本原因很可能是Radeon GL驱动程序库需要一个最近的libstdc++。比和模拟器绑定的那个。

Here's how I fixed the problem :

我是这样解决这个问题的:

  1. Install lib64stdc++6

    安装lib64stdc + + 6

    $ sudo apt-get install lib64stdc++6:i386   
    
  2. Install mesa-demos

    安装mesa-demos

    $ sudo apt-get install mesa-utils
    
  3. Move libstdc++.so.6 out of the way by renaming it to libstdc++.so.6.bak

    移动libstdc + + . so。6.通过将其重命名为libstdc+ .so. bak来解决这个问题

    $ cd ~/$ANDROID_HOME/Android/Sdk/tools/lib64/libstdc++
    $ mv libstdc++.so.6 libstdc++.so.6.bak
    

#7


2  

after the update to build tools 25.3.1 libstdc++.so.6 file had been moved to $ANDROID_HOME/Sdk/emulator/lib64/libstdc++/libstdc++.so.6

在更新后构建工具25.3.1 libstdc+ .so。文件已被移动到$ANDROID_HOME/Sdk/模拟器/lib64/libstdc++/libstdc++. so6

#8


1  

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

Try it!

试一试!

#9


0  

In an extraordinary situation your KVM resources might be busy because of another running VirtualBox VMs.

在特殊情况下,由于另一个正在运行的虚拟机,KVM资源可能会很忙。

(I've experienced this issue).

(我经历过这个问题)。

To overcome this issue I used Genymotion instead of Android Emulator.

为了克服这个问题,我使用了Genymotion而不是Android模拟器。

Then I could run Genymotion together with other VirtualBox VMs.

然后我可以与其他虚拟机一起运行Genymotion。

#10


0  

Fix on Ubuntu 16 LTS

修复ubuntu16lts

1.Install lib64stdc++6

1。安装lib64stdc + + 6

sudo apt-get install lib64stdc++6:i386  

2.Install mesa-demos

2。安装mesa-demos

sudo apt-get install mesa-utils

#11


0  

sudo apt-get install mesa-utils

Ref: https://github.com/beidl/prime-indicator/issues/6

裁判:https://github.com/beidl/prime-indicator/issues/6

#12


0  

All of the above answers did not work for me as "Android Emulator" was not installed with standard installation of Android Studio. Make sure you have installed it and then try above answers. 无法在android studio 2.0中启动模拟器

以上答案对我都不起作用,因为“Android模拟器”并没有安装在Android Studio的标准安装中。确保你已经安装了它,然后尝试上面的答案。

#13


0  

I had the same problem and the solution didn't work for me.

我遇到了同样的问题,但解决方案对我不起作用。

The solution that work for me was telling to Android Studio that use the system libraries instead of the built-in by editing $HOME/.profile and adding the next line: export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1, and then re-log.

我的解决方案是告诉Android Studio使用系统库而不是通过编辑$HOME/来使用内置库。配置文件并添加下一行:导出ANDROID_EMULATOR_USE_SYSTEM_LIBS=1,然后重新记录。

#14


0  

Create a new AVD, or edit an existing one and change the Emulated Performance Graphics from Automatic to Software

创建一个新的AVD,或者编辑一个现有的AVD,并将模拟的性能图形从自动变为软件

无法在android studio 2.0中启动模拟器