无法让 Android 模拟器在 Eclipse 中运行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2473553/
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
Trouble getting Android emulator to run in eclipse
提问by Sharonix
I'm trying to run the SDK Samples on the Emulator in Eclipse 3.5.
我正在尝试在 Eclipse 3.5 中的模拟器上运行 SDK 示例。
Most of the time the AVD Manager hangs when I try to create a new AVD. When I manage to create an AVD and try to start the emulator I get this:
大多数情况下,当我尝试创建新的 AVD 时,AVD 管理器会挂起。当我设法创建一个 AVD 并尝试启动模拟器时,我得到了这个:
emulator: ERROR: no search paths found in this AVD's configuration
模拟器:错误:在此 AVD 的配置中找不到搜索路径
weird, the AVD's config.ini file is malformed. Try re-creating it.
奇怪的是,AVD 的 config.ini 文件格式错误。尝试重新创建它。
I'm running the latest version of the SDK on Win7 32 bit. Any ideas?
我在 Win7 32 位上运行最新版本的 SDK。有任何想法吗?
Update:
更新:
I think I found the source of the problem. I'm running a Hebrew version of WIN 7. My user name is in Hebrew. Apparently this causes a problem for Eclipse. Once I started to suspect that was the problem, I created a new user on the system called DEV and tried to run the emulator under that user. Went like butter.
我想我找到了问题的根源。我正在运行 WIN 7 的希伯来语版本。我的用户名是希伯来语。显然,这会导致 Eclipse 出现问题。一旦我开始怀疑这是问题所在,我就在名为 DEV 的系统上创建了一个新用户,并尝试在该用户下运行模拟器。像黄油一样。
回答by Dmitriy Ganzin
You can set the environment variable ANDROID_SDK_HOME
. For example:
您可以设置环境变量ANDROID_SDK_HOME
。例如:
ANDROID_SDK_HOME=D:\Development\android-sdk\
It helped me. Add this variable to <eclipseFolder>\configuration\.settings\org.eclipse.ui.ide.prefs
:
它帮助了我。将此变量添加到<eclipseFolder>\configuration\.settings\org.eclipse.ui.ide.prefs
:
ANDROID_SDK_HOME=D\:\Development\android-sdk\
Stop the process adb.exe
and (re)start Eclipse.
停止进程adb.exe
并(重新)启动 Eclipse。
回答by Michael Sch?ler
The problem here is that my c:\users... path has foreign characters in it "Michael Sch?ler" - the "?" being the problem.
这里的问题是我的 c:\users... 路径中有外来字符“Michael Sch?ler”——“?” 是问题所在。
This is an ecclipse and/or Android SDK problem.
这是一个日食和/或 Android SDK 问题。
回答by András Bánusz
Another rather simple solution to this problem (non-english characters in the AVD's path), is to use the "shortname" of the directories. In my case:
这个问题的另一个相当简单的解决方案(AVD 路径中的非英文字符)是使用目录的“短名称”。就我而言:
My windows user is "András", so my homedir is C:\Users\András
我的 Windows 用户是“András”,所以我的 homedir 是 C:\Users\András
If you open up a cmd, cd to C:\Users, and issue a "dir /x" command, you will see the "shortnames" of the directories, in my case it is "ANDRS~1".
如果您打开一个 cmd,cd 到 C:\Users,并发出“dir /x”命令,您将看到目录的“shortnames”,在我的例子中是“ANDRS~1”。
So you just change the path in the AVD's config file from C:\Users\András\blabla to C:\Users\ANDRS~1\blabla, and voila, it works.
因此,您只需将 AVD 配置文件中的路径从 C:\Users\András\blabla 更改为 C:\Users\ANDRS~1\blabla,瞧,它就可以工作了。
回答by azproduction
move c:\Users\YourName\.android\avd\YourAVDName.avd
manually to c:\Android\YourAVDName.avd
then open c:\Users\YourName\.android\avd\YourAVDName.ini
and change path from
path=c:\Users\YourName\.android\avd\YourAVDName.avd
to path=c:\Android\YourAVDName.avd
c:\Users\YourName\.android\avd\YourAVDName.avd
手动移动到c:\Android\YourAVDName.avd
然后打开c:\Users\YourName\.android\avd\YourAVDName.ini
并将路径更改
path=c:\Users\YourName\.android\avd\YourAVDName.avd
为path=c:\Android\YourAVDName.avd
回答by JOnas Westin
I had a similar problem because of non-latin letters in my username. When opening the ini-file in a text editor I found the non-latin characters was wrong. So I just changed the path from path=c:\Users\YourNa¤%"%¤%%¤me.android\avd\YourAVDName.avd to path=c:\Users\YourName.android\avd\YourAVDName.avd and it worked.
由于我的用户名中的非拉丁字母,我遇到了类似的问题。在文本编辑器中打开 ini 文件时,我发现非拉丁字符是错误的。所以我只是将路径从 path=c:\Users\YourNa¤%"%¤%%¤me.android\avd\YourAVDName.avd 更改为 path=c:\Users\YourName.android\avd\YourAVDName.avd 和有效。
回答by Peter
If you have special character in your username do this:
~/.android/avd on OS X and Linux, C:\Documents and Settings\user\.android\ on Windows XP, and C:\Users\user\.android\avd on Windows Vista, 7.
There name.ini and name.avd folder
- copy the folder for example: C:\
- modifiy the path in the .ini to path=C:\name.avd
如果您的用户名中有特殊字符,请执行以下操作:
OS X 和 Linux 上的 ~/.android/avd,Windows XP 上的 C:\Documents and Settings\user\.android\ 和 C:\Users\user\.android\ avd 在 Windows Vista 上,7.
有 name.ini 和 name.avd 文件夹
- 复制文件夹例如:C:\
- 将 .ini 中的路径修改为 path=C:\name.avd
回答by Ilya.Suharev
You have to use Android tool from sdk\toolsfolder to move your AVD device to some Folder with no foreign characters in the path.
您必须使用sdk\tools文件夹中的Android 工具将您的 AVD 设备移动到路径中没有外来字符的某个文件夹。
Just type android move avd -n "nameofdevice" -p "newpath"
只需输入 android move avd -n "nameofdevice" -p "newpath"
For example: android move avd -n HTDDESIRE -p C:\HTCDESIRE
例如: android move avd -n HTDDESIRE -p C:\HTCDESIRE
回答by Dimitrov
I also had the same problem since my username was in Cyrilic letters Димитров.
我也遇到了同样的问题,因为我的用户名是西里尔字母 Димитров。
I change it to a latin alphabet and then it's OK.
我将其更改为拉丁字母,然后就可以了。
回答by Greg Zimmers
To make sure everything is installed correctly, I recommend you reinstall all the components. To be sure everything goes correctly follow my step by step instructions on my blog.
为了确保一切安装正确,我建议您重新安装所有组件。为确保一切正常,请按照我博客上的分步说明进行操作。
http://androidcodemonkey.blogspot.com/2010/01/how-to-setup-android-development_23.html
http://androidcodemonkey.blogspot.com/2010/01/how-to-setup-android-development_23.html
If you follow all the steps you should be good to go!
如果您按照所有步骤操作,您应该很高兴!
Good luck.
祝你好运。
回答by Roger Weber
I had the same error. What I found was that I was missing ARM EABI v7a System Image.
我有同样的错误。我发现我缺少 ARM EABI v7a 系统映像。
I fixed it by opening the Android SDK Manager (The tool bar button looks like a little white arrow in a gray box with green android head)
我通过打开 Android SDK 管理器修复了它(工具栏按钮看起来像一个带有绿色 android 头的灰色框中的白色小箭头)
I checked the missing system image and clicked the install button.
我检查了丢失的系统映像并单击了安装按钮。
See this topic.
请参阅此主题。