简体   繁体   English

适用于Android 4.4 KitKat的模拟器无法启动

[英]Emulator for Android 4.4 KitKat is not starting

I am creating an emulator for Android 4.4 KitKat, but the emulator takes very long and isn't starting. 我正在为Android 4.4 KitKat创建一个模拟器,但模拟器需要很长时间才能启动。 I tried many devices like Nexus4, Galaxy Nexus, Nexus S etc. but none of that worked. 我尝试了许多设备,如Nexus4,Galaxy Nexus,Nexus S等,但都没有。 Just a black screen with the android logo for long time. 只是一个带有android徽标的黑屏很长一段时间。 Any suggestions? 有什么建议?

Unfortunately the emulator does take a very long time to load. 不幸的是,仿真器确实需要很长时间才能加载。 A regular complaint amongst Android developers. Android开发人员定期投诉。

It sometimes helps if you go into the AVD configuration and modify your KitKat emulator and tick the checkbox that says Use Host GPU . 如果您进入AVD配置并修改KitKat仿真器并勾选“ Use Host GPU ”复选框,有时会有所帮助。 This makes it slightly faster. 这使它稍微快一些。

Also I've found that if you use the default RAM space that it decides, usually over 1000, it takes a stupidly long time, if it loads up at all. 另外我发现如果你使用它决定的默认RAM空间,通常超过1000,如果它完全加载,则需要一段很长的时间。 I usually set mine to 512MB, 700+MB at a push but reducing the amount of RAM that the emulator can have helps. 我通常将我的设置设置为512MB,700 + MB,但减少了仿真器可以提供的RAM量。

There is also a different emulator you can use, although it currently doesn't yet support KitKat, although they say its coming soon, I've heard quite a few positive comments. 你可以使用另外一个不同的模拟器,虽然它目前尚不支持KitKat,虽然他们说它即将推出,但我听到了不少积极的评论。

You can find the alternative emulator at http://www.genymotion.com/ 您可以在http://www.genymotion.com/找到替代模拟器

UPDATE UPDATE

Google have released a new version of the Android Emulator with Android Studio 2. Unfortunately, AS, the build tools and the emulator are in Beta/Release Candidates but I've been using them for a while for my own apps and had no problems, but also found that the emulator is much improved from the old one. 谷歌已经发布了Android版2的Android模拟器的新版本。不幸的是,AS,构建工具和模拟器都在Beta / Release Candidates中,但我已经使用它们一段时间用于我自己的应用程序并且没有问题,但也发现仿真器从旧的改进了很多。 http://tools.android.com/tech-docs/emulator will show you what's new and how to get the new emulator. http://tools.android.com/tech-docs/emulator将向您展示新功能以及如何获取新模拟器。

To find what the problem exactly is, try to run emulator with -debug-all . 要找到问题的确切原因,请尝试使用-debug-all运行模拟器。 In my case emulator freezed after: 在我的情况下模拟器冻结后:

$./emulator -avd 4.4 -partition-size 1024 -debug-all
emulator: found SDK root at ~/data/develop/android/android-sdk-linux
…blah-blah-blah…
emulator: qpa_audio_init: entering
and -noaudio option solved the problem. -noaudio选项解决了这个问题。

It may help to start the first run of the emulator with a very small amount of memory (say 200mb) 使用非常少量的内存(例如200mb)启动模拟器的第一次运行可能会有所帮助

On my machine the emulator refused to start (I waited 30 minutes and then killed it) with 700MB It just showed a blank screen - not even the Android message. 在我的机器上,模拟器拒绝启动(我等了30分钟,然后杀了它),700MB它只是显示一个空白屏幕 - 甚至不是Android消息。

When I reduced the memory to 128MB the emulator fired up in the normal time (about 50 seconds on my m/c) but had insufficient RAM to load the background apps. 当我将内存减少到128MB时,模拟器在正常时间(我的m / c上大约50秒)启动,但没有足够的RAM来加载后台应用程序。 I changed it to 256 MB and everything burst into life. 我将它改为256 MB,一切都破灭了。 Now I can change the memory up to 768MB it now loads fine in the same timeframe. 现在我可以将内存更改为768MB,现在可以在相同的时间内正常加载。

Seems like the first run needs to be with a small(er) amount of memory but once that has succeeded you can increase them memory (up to 768MB on Windows) without a problem. 似乎第一次运行需要使用少量内存,但一旦成功,您可以增加内存(Windows上最多768MB)而不会出现问题。

I had the same problem with ... 我有同样的问题......

The solution that worked for me with x86 emulator was to update HAXM with the last version and to restart my computer. 使用x86模拟器的解决方案是使用最新版本更新HAXM并重新启动计算机。

http://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager http://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager

I hope it will help and solve the problem for many of you. 我希望它能为你们中的许多人提供帮助并解决问题。

Regards 问候

Maybe ADB is kaput! 也许亚行是个疯子!

If you're using Windows to develop Android, then open a DOS session at \\android-sdk\\platform-tools\\ directory (Note: This is a sub-directory of the Android SDK installation). 如果您使用Windows开发Android,则在\\android-sdk\\platform-tools\\目录下打开DOS会话(注意:这是Android SDK安装的子目录)。

At the DOS window, type: 在DOS窗口中,键入:

adb kill-server

This would kill the current Android Debug Bridge (ADB). 这会杀死当前的Android Debug Bridge(ADB)。 Then, start it again by typing: 然后,键入以下命令再次启动它:

adb start-server

To verify if your Android 4.4 KitKat emulator is running, type: 要验证您的Android 4.4 KitKat模拟器是否正在运行,请键入:

adb devices

If it still doesn't work, repeat the above steps. 如果仍然无效,请重复上述步骤。 Else, restart your IDE (Eclipse, Android Studio, etc) and try again. 否则,重新启动IDE(Eclipse,Android Studio等)并重试。

I had the same problem, what helped was reboot my computer and start the emulator with only a few programs open (Eclipse, Chrome and nothing more). 我有同样的问题,有什么帮助重新启动我的计算机并启动模拟器只打开几个程序(Eclipse,Chrome,仅此而已)。 My development computer is a 4 GB notebook with integrated graphics running Ubuntu 12.04. 我的开发计算机是一个4 GB笔记本电脑,集成显卡运行Ubuntu 12.04。 Nothing fancy, and the KitKat emulator works. 没什么好看的,KitKat模拟器也可以工作。 Very slowly, as expected :(, but works. 非常缓慢,正如所料:(,但有效。

Take into account that emulators are memory hungry, perhaps your development machine is low on resources when you try to run them? 考虑到模拟器是内存饥饿的,当您尝试运行它们时,您的开发机器可能资源不足?

Mine gets sigabort on surface flinger unless I enable "Use Host GPU". 除非我启用“使用主机GPU”,否则我会在表面上使用sigabort。

EDIT: Seems this is related to extreme resolutions. 编辑:似乎这与极端分辨率有关。 Try using lower resolution... if You do use res like 1080x1920 - enabling Host GPU works for me 尝试使用较低分辨率...如果您使用像1080x1920这样的res - 启用主机GPU适合我

Check adb logcat output from emulator while booting, if yours is similar it might work. 在启动时检查来自模拟器的adb logcat输出,如果你的类似,它可能会起作用。

Please find log below... 请在下面找到日志...

I/Vold    (   46): Vold 2.1 (the revenge) firing up
I/Netd    (   48): Netd 1.0 starting
D/Vold    (   46): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media)
W/InterfaceController(   48): Warning (dlopen failed: library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
I/SurfaceFlinger(   51): SurfaceFlinger is starting
I/SurfaceFlinger(   51): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
D/libEGL  (   51): Emulator without GPU support detected. Fallback to software renderer.
D/libEGL  (   51): loaded /system/lib/egl/libGLES_android.so
D/gralloc_goldfish(   51): Emulator without GPU emulation detected.
E/SurfaceFlinger(   51): hwcomposer module not found
E/SurfaceFlinger(   51): ERROR: failed to open framebuffer (No such file or directory), aborting
F/libc    (   51): Fatal signal 6 (SIGABRT) at 0x00000033 (code=-6), thread 51 (surfaceflinger)
I/DEBUG   (   49): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (   49): Build fingerprint: 'generic/sdk/generic:4.4.2/KK/986172:eng/test-keys'
I/DEBUG   (   49): Revision: '0'
I/DEBUG   (   49): pid: 51, tid: 51, name: surfaceflinger  >>> /system/bin/surfaceflinger <<<
I/DEBUG   (   49): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I/DEBUG   (   49):     r0 00000000  r1 00000033  r2 00000006  r3 00000000
I/DEBUG   (   49):     r4 00000006  r5 00000002  r6 00000033  r7 0000010c
I/DEBUG   (   49):     r8 b6fd084d  r9 b7f1552c  sl 00000000  fp bef71b9c
I/DEBUG   (   49):     ip fffffffe  sp bef719e8  lr b6f34ead  pc b6f43e20  cpsr 00000010
I/DEBUG   (   49):     d0  0036f09323cb6394  d1  0000000000000000
I/DEBUG   (   49):     d2  0000000000000000  d3  0000000000000000
I/DEBUG   (   49):     d4  0000000000000000  d5  41c1e5b1ca000000
I/DEBUG   (   49):     d6  3f50624dd2f1a9fc  d7  414b7849ee147ae1
I/DEBUG   (   49):     d8  0000000000000000  d9  0000000000000000
I/DEBUG   (   49):     d10 0000000000000000  d11 0000000000000000
I/DEBUG   (   49):     d12 0000000000000000  d13 0000000000000000
I/DEBUG   (   49):     d14 0000000000000000  d15 0000000000000000
I/DEBUG   (   49):     scr 00000010
I/DEBUG   (   49): 

Having had the same problem, I configured AVD to use 516MB of RAM and it loaded ok. 遇到了同样的问题,我将AVD配置为使用516MB的RAM并加载好了。 Hope this helps you or someone else. 希望这可以帮助你或其他人。

The biggest problem with the SDK right now is that there is no x86 emulator image posted. SDK现在最大的问题是没有发布x86模拟器映像。

However, I did get a KitKat x86 emulator working in Windows by hacking together INIs from an x86 JB AVD and an ARM KitKat AVD, as well as building aosp_x86-eng and copying over the prebuilt QEMU kernel for x86 from the KitKat AOSP into my Windows host. 但是,我确实通过在x86 JB AVD和ARM KitKat AVD中混合使用INI来获取KitKat x86仿真器,以及构建aosp_x86-eng并将预装的QEMU内核从KitKat AOSP复制到我的Windows中主办。 An x86 KitKat image running in Windows with the HAXM extensions is very fast, as fast or faster than running on actual hardware, particularly with "Use host GPU" enabled. 在Windows中运行的带有HAXM扩展的x86 KitKat映像非常快,比在实际硬件上运行快,速度快,特别是启用了“使用主机GPU”。

If you're not building Android itself, this probably doesn't help you. 如果您不是自己构建Android,这可能对您没有帮助。 But if you ARE building AOSP (or you can find a prebuilt x86 KitKat Android image and QEMU kernel online), I can post additional details on how to get it working in Windows. 但是如果您正在构建AOSP(或者您可以在线找到预构建的x86 KitKat Android映像和QEMU内核),我可以发布有关如何在Windows中使用它的其他详细信息。

This might have been answered ...but I had an issue and it got solved...please see this post and I am sure you will hit it correct: Setting Up Android 4.4 kitkat emulator 这可能已经回答了...但是我遇到了问题并且它已经解决了......请看这篇文章我相信你会认真对待设置Android 4.4 kitkat模拟器

Let me know if it works... 让我知道它是否有效......

I had the same issue. 我遇到过同样的问题。 Updating Intel HAXM Accelerator from 1.0.1 to 1.0.8 (current release) did the trick for me. 将Intel HAXM Accelerator从1.0.1更新到1.0.8(当前版本)为我做了诀窍。

I had similar issues on a Windows Server 2012 R2 installation. 我在Windows Server 2012 R2安装上遇到过类似的问题。 The root cause was a missing video driver (the vanilla Microsoft one wasn't enough). 根本原因是缺少视频驱动程序(香草微软的驱动程序还不够)。 I was working with a cobbled-together frankenbox and found it useful to follow the instructions on finding the right driver here: 我正在使用一个拼凑在一起的frankenbox,并发现在这里按照有关找到正确驱动程序的说明很有用:

http://support.amd.com/en-us/kb-articles/Pages/HowtoidentifythemodelofanATIgraphicscard.aspx#DID http://support.amd.com/en-us/kb-articles/Pages/HowtoidentifythemodelofanATIgraphicscard.aspx#DID

Once I had the right drivers the emulator started up just fine... 一旦我有了正确的驱动程序,模拟器启动就好了......

Firstly go to SDK manager plugin of Your IDE and choose the API level for which you are going to create Android Virtual Device. 首先转到IDE的SDK管理器插件,然后选择要为其创建Android虚拟设备的API级别。 And make sure that API's SDK Platform is installed. 并确保安装了API的SDK平台。 If SDK showing Not installed , then firstly download it. 如果SDK显示未安装,则首先下载它。

After automatic Installation on Downloading completion. 在下载完成后自动安装。 Restart your IDE . 重新启动IDE。 Start your AVD plugin and then select the API for your AVD that you download. 启动AVD插件,然后选择您下载的AVD API。

In my case, the solution was to switch to a different system image. 就我而言,解决方案是切换到不同的系统映像。 I was using the Atom x86_64 one, and as soon as I switched to Atom x86, the emulator worked perfectly. 我正在使用Atom x86_64,当我切换到Atom x86时,模拟器工作得很好。

I think there is a bug in system image of Intel x86(Kitkat). 我认为Intel x86(Kitkat)的系统映像存在错误。 Because it happens only with -partition-size and -memory option to use more than 256MB stroage and memory. 因为只有使用-partition-size和-memory选项才能使用超过256MB的内存和内存。

So I've change the system image, there is two system images for kitkat, one is Intel x86 Atom system image and the other is Google APIs(x86 system image). 所以我改变了系统映像,kitkat有两个系统映像,一个是Intel x86 Atom系统映像,另一个是Google API(x86系统映像)。 For me it does not happen with Google APIs image. 对我来说,谷歌API图像不会发生这种情况。

Use command line once, and then it will work normally from the Studio as well: 使用命令行一次,然后它也可以从Studio正常工作:

emulator -avd ExampleVDName -debug-all -noaudio -nocache -wipe-data -dns-server 8.8.8.8

Before using this, don't forget to navigate to the tools directory. 在使用它之前,不要忘记导航到tools目录。 You need to know where your SDK is located. 您需要知道SDK的位置。 In my case, I had to navigate to this directory first, and then use the command above. 在我的情况下,我必须首先导航到此目录,然后使用上面的命令。

cd C:\\AndroidSDK\\tools

Ps: don't forget to use the name of your own Virtual Device, instead of ExampleVHDName . Ps:不要忘记使用您自己的虚拟设备的名称,而不是ExampleVHDName

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM