Eclipse Android 模拟器无法启动

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11674306/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:26:05  来源:igfitidea点击:

Eclipse Android Emulator won't launch

androideclipseubuntuopengl-esadt

提问by tutak

I have installed Eclipse 4.2 with Eclipse android plugin(ADT)on ubuntu 11.10. when i launch "Hello World" project as an android application, it simply wont launch!

我已经在 ubuntu 11.10 上安装了带有 Eclipse android 插件(ADT)的 Eclipse 4.2。当我将“Hello World”项目作为 android 应用程序启动时,它根本无法启动!

ps -x > log.txt after launching the emulator, output:

ps -x > log.txt 启动模拟器后,输出:

1000      7221 20.0  0.6  16884  6908 ?        D    18:11   0:00 /home/tutakhail/android-sdks/tools/emulator-arm -avd AndroidBrowser -netspeed full -netdelay none

launching the emulator manually from shell, i get the following error, shortly after which the emulator launches but is very slow.

从 shell 手动启动模拟器,我收到以下错误,不久之后模拟器启动但速度很慢。

emulator: ERROR: Could not load OpenGLES emulation library: libOpenglRender.so:    cannot open shared object file: No such file or directory
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.

Any hints on what could be the issue here? Perhaps related to Ubuntu?

关于这里可能是什么问题的任何提示?也许与Ubuntu有关?

采纳答案by tutak

I guess its a bug affecting the latest versions of the ADTs perhaps has something to do with NVIDIA GPUs drivers. The issue is discussed here:

我猜这是一个影响 ADT 最新版本的错误,可能与 NVIDIA GPU 驱动程序有关。这个问题在这里讨论:

https://groups.google.com/forum/?fromgroups#!topic/adt-dev/nlA07toW1fc

https://groups.google.com/forum/?fromgroups#!topic/adt-dev/nlA07toW1fc

The work around that I have found which at least lets me execute my applications till a permanent solution is released, is that by first launching the emulator from shell even if it throws the error. After which i right-click and run my projects as an "Android application". The emulator does surprisingly execute them!

我发现至少可以让我执行我的应用程序直到发布永久解决方案的解决方法是,首先从 shell 启动模拟器,即使它抛出错误。之后,我右键单击并将我的项目作为“Android 应用程序”运行。模拟器确实出人意料地执行了它们!

回答by parry

Turns out the solution is to point LD_LIBRARY_PATH to the /tools/lib path. Below works for me.

原来的解决方案是将 LD_LIBRARY_PATH 指向 /tools/lib 路径。下面对我有用。

? tools file ../tools/lib/libOpenglRender.so ../tools/lib/libOpenglRender.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped

? 工具文件 ../tools/lib/libOpenglRender.so ../tools/lib/libOpenglRender.so:ELF 32 位 LSB 共享对象,Intel 80386,版本 1 (SYSV),动态链接,未剥离

? tools export LD_LIBRARY_PATH=/home/xxxx/devel/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH

? 工具导出 LD_LIBRARY_PATH=/home/xxxx/devel/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH

? tools ./emulator-x86 -avd AtomX86 -gpu on -qemu -m 1024 -enable-kvm

? 工具 ./emulator-x86 -avd AtomX86 -gpu on -qemu -m 1024 -enable-kvm

emulator: emulator window was out of view and was recentered ....

模拟器:模拟器窗口不在视野范围内并重新居中....

回答by Maksym Stakhieiev

I've got similar error, and I guess this error caused by missing libGL.so.

我有类似的错误,我猜这个错误是由于缺少 libGL.so 引起的。

Install package libgl1-mesa-dev;

安装包 libgl1-mesa-dev;

sudo apt-get install libgl1-mesa-dev

Source

来源

回答by thethakuri

I tried to use the Intel Hardware Acceleration in Ubuntu 12.04 for running emulators using KVM package. However I was getting the error, "Failed to start RenderThread". Installing the package libgl1-mesa-devand reducing the Device RAM Sizeto 512solved my problem. The emulator now is indeed atleast 10X faster. I hope this would help someone trying to emulate android devices in Ubuntu using Intel processor that supports Virtualizattion Technology.

我尝试在 Ubuntu 12.04 中使用英特尔硬件加速来运行使用 KVM 包的模拟器。但是我收到了错误,“无法启动 RenderThread”。安装包libgl1-mesa-dev并将设备 RAM 大小减少到512解决了我的问题。模拟器现在确实至少快了 10 倍。我希望这会帮助那些尝试使用支持虚拟化技术的英特尔处理器在 Ubuntu 中模拟 android 设备的人。

回答by Diego Torres Milano

Try running emulatorfrom command line first to see if everything goes well. You may need to add options like:

首先尝试从命令行运行模拟器,看看是否一切顺利。您可能需要添加以下选项:

-no-audio 
-gpu off

I've seen audio preventing emulator to start on some Ubuntu configurations.

我已经看到音频阻止模拟器在某些 Ubuntu 配置上启动。

回答by Ricardo Jl Rufino

Configure ANDROID_HOME

配置 ANDROID_HOME

export ANDROID_HOME=//android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

export ANDROID_HOME=//android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

and set LD_LIBRARY_PATH

并设置 LD_LIBRARY_PATH

export LD_LIBRARY_PATH="$ANDROID_HOME/emulator/lib64:$LD_LIBRARY_PATH"

导出 LD_LIBRARY_PATH="$ANDROID_HOME/emulator/lib64:$LD_LIBRARY_PATH"

To run ARM version

运行ARM版本

cd $ANDROID_HOME/emulator/
./emulator64-arm -avd Nexus_5X_ARM_22 -no-audio -gpu off

cd $ANDROID_HOME/emulator/
./emulator64-arm -avd Nexus_5X_ARM_22 -no-audio -gpu off

回答by Android2390

SO i guess maybe you haven't installed everything properly.

所以我想也许你没有正确安装所有东西。

You should check if you followed the steps as shown in : http://www.wikihow.com/Install-Android-on-Ubuntu-Linux-With-Eclipse-Ide

您应该检查是否按照以下步骤操作:http: //www.wikihow.com/Install-Android-on-Ubuntu-Linux-With-Eclipse-Ide

After installing it properly and setting up the PATH environment variables . Also another thing you can do is try deleting the AVD emulator and creating a new one and then try again .

正确安装并设置 PATH 环境变量后。您还可以做的另一件事是尝试删除 AVD 模拟器并创建一个新的模拟器,然后再试一次。

Also i found your question over here at : https://groups.google.com/forum/?fromgroups#!topic/adt-dev/nlA07toW1fc

我也在这里找到了你的问题:https: //groups.google.com/forum/?fromgroups#!topic/adt-dev/nlA07toW1fc

THe question you asked is not really specific so just try following the steps.

您提出的问题并不是很具体,因此请尝试按照步骤操作。

回答by user3069932

If using eclipse, you have to add in Project-Properties in the "Java Build Path" -> Libraries -> Android 4.4 -> "Native library location" the path to sdk/tools/lib directory. For me this is "install-dir-of-sdk"/sdk/tools/lib"

如果使用eclipse,则必须在“Java Build Path”-> Libraries -> Android 4.4 -> “Native library location”中的Project-Properties 中添加sdk/tools/lib 目录的路径。对我来说,这是“install-dir-of-sdk”/sdk/tools/lib”

回答by kamil

The following command saved my life with the same problem

以下命令因同样的问题救了我的命

sudo apt-get install libgl1-mesa-dev

回答by GMLewisII

I solved this on my Red Hat Linux 64 bit by installing the 32bit libGL (it should be located in /usr/lib/)

我通过安装 32 位 libGL(它应该位于 /usr/lib/)在我的 Red Hat Linux 64 位上解决了这个问题

 sudo yum install mesa-libGL.i686