Linux android无法启动模拟器:无法运行程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14578557/
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-06 18:50:19  来源:igfitidea点击:

android Failed to start emulator:Cannot run program

androidlinuxeclipseubuntu

提问by Anas Rabei

I have installed android SDK and android eclipse plugin successfully on Ubuntu.

我已经在 Ubuntu 上成功安装了 android SDK 和 android eclipse 插件。

Every thing was working fine until I removed Ubuntu and installed Linux Mint. I installed the SDK again and used the same eclipse copy I was using on Ubuntu but now all the android applications contain errors and I can not start the emulator.

一切都很好,直到我删除了 Ubuntu 并安装了 Linux Mint。我再次安装了 SDK 并使用了我在 Ubuntu 上使用的相同 eclipse 副本,但现在所有的 android 应用程序都包含错误,我无法启动模拟器。

When starting the emulator this message appears

启动模拟器时出现此消息

Starting emulator for AVD 'test' Failed to start emulator: Cannot run program "/home/anas/android//tools/emulator": error=2, No such file or directory

While the android SDK is installed in the specified path and the file (emulator) is exists in the same path.

而android SDK安装在指定路径中并且文件(模拟器)存在于同一路径中。

Also all my applications contains the same error R can not be resolved to a variable

我所有的应用程序也包含相同的错误 R can not be resolved to a variable

What is the problem here?

这里有什么问题?

采纳答案by Usman Kurd

  1. Installed on Ubuntu successfully. but not running avd

    If you're running a 64-bit system, you need to install ia32-libs

  1. 在 Ubuntu 上安装成功。但没有运行 avd

    如果您运行的是 64 位系统,则需要安装 ia32-libs

  sudo apt-get install ia32-libs
  sudo apt-get install ia32-libs
  1. R can not be resolved to a variable
  1. R无法解析为变量

This can be due to following Reason

这可能是由于以下原因

  • class is not the part of that package add proper package

  • not properly defined in manifest file class path define it properly

  • 类不是该包的一部分添加适当的包

  • 在清单文件类路径中未正确定义正确定义它

clear and run the avd it will work

清除并运行 avd 它将起作用

回答by Babu

Like you have written the specified path and the files are exists in the same path, but i suggest to check that one more time.

就像您写了指定的路径并且文件存在于同一路径中一样,但我建议再检查一次。

and like you are getting R cannot be resolved to a variable, do not worry:

就像你得到 R 无法解析为变量一样,不要担心:

Reasons:

原因:

  1. Check Package name in ManifestFile
  2. If you are already getting something like this: import com.version.bajrang.january.R;so first of all try to change package namehere, or secondly just delete this lineand clean your program
  3. If you are not gettingsomething like: import com.version.bajrang.january.R; then add import packagename.R;
  1. 检查清单文件中的包名称
  2. 如果你已经得到这样的东西:import com.version.bajrang.january.R; 所以首先尝试在这里更改包名,或者其次只是删除这一行并清理您的程序
  3. 如果你没有得到类似的东西:import com.version.bajrang.january.R; 然后添加 import packagename.R;

I believe that you will get your answer.....

我相信你会得到你的答案......

回答by quinestor

It looks like your SDK path in eclipse has a mistake:

看起来您在 eclipse 中的 SDK 路径有误:

Cannot run program "/home/anas/android//tools/emulator"

无法运行程序“/home/anas/android//tools/emulator”

That double "//" may be the problem. Check in Eclipse: Window -> Preferences -> Android. There should be a field there pointing the SDK Location. Edit it.

那个双“//”可能是问题所在。签入 Eclipse:窗口 -> 首选项 -> Android。那里应该有一个指向 SDK 位置的字段。编辑它。

Check your path : /home/anas/android/ to see if it really is where you put your SDK . If not repeat thesesteps to have it

检查您的路径: /home/anas/android/ 看看它是否真的是您放置 SDK 的地方。如果没有重复这些步骤来拥有它

The missing R resource message is a compile error right? Then in this case your emulator should not be the problem. However, if your SDK path is incorrect like I suspect, then .. you can expect this compile error along with any other android libraries import

缺少的 R 资源消息是编译错误,对吗?那么在这种情况下,您的模拟器应该不是问题。但是,如果您的 SDK 路径像我怀疑的那样不正确,那么 .. 您可以预期此编译错误以及任何其他 android 库导入

回答by T0plomj3r

If cmd from fist comment doesn't work like in my case (64bit Crunchbang) then you may also try with :

如果来自拳头评论的 cmd 不像我的情况(64位 Crunchbang)那样工作,那么你也可以尝试:

sudo aptitude install ia32-libs lib32ncurses5 lib32stdc++6

须藤 aptitude 安装 ia32-libs lib32ncurses5 lib32stdc++6

回答by Bolan

I used the command-line tool android (android avd), and used Tools->Manage SDK to install 64 bit emulators. I then mv'ed emulator to emulator.old, and emulator64-arm to emulator. Now the AVD starts up.

我使用命令行工具android( android avd),并使用Tools->Manage SDK安装64位模拟器。然后我将 emulator 转为 emulator.old,将 emulator64-arm 转为 emulator。现在 AVD 启动。

回答by debbie

You do not need install packages any more!

您不再需要安装包了!

In directory tools, there are many types of emulator, while my computer works with emulator64-arm! My system is Linux Mint 16 amd64! Good luck!

在目录工具中,有很多类型emulator,而我的电脑使用的是emulator64-arm! 我的系统是Linux Mint 16 amd64!祝你好运!

./emulator64-arm @yxphone -sdcard yxsd -scale 0.8

回答by alvaro g

I solved it doing a backup of the "emulator" and creating a symbolic link to the correct emulator:

我通过备份“模拟器”并创建到正确模拟器的符号链接解决了这个问题:

mv emulator emulator_bup
ln -s emulator64-arm emulator