When creating your Android Virtual Device (AVD), Professional Android 4 Application Development recommends using the Galaxy Nexus skin (WXGA720) to skin your emulator, like so:
So I went ahead and did that, and then tried to run my AVD...
The error reads:
Failed to allocate memory: 8
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Well that's not very helpful. Failed to allocate memory for what? And what does the 8 mean?
I did some Googling, and found my issue. It turns out the default resolution for the Galaxy Nexus skin is 720x1280, while my PC's resolution is a measly 1920x1080. When trying to launch the emulator, it seems Eclipse tries to fit the AVD's display inside your screen, and, if it doesn't fit, crashes with a not-so-helpful error message.
The Solution was simple enough: I switched my skin to WVGA854, with a native resolution of 480x854 -- small enough to fit on my screen -- and boom, Hello World!
"But you said you hadn't written a single line of code yet," you exclaim with bewilderment. "Hello World" is the default activity created by Eclipse when you start a fresh Android Application Project. Technically, I deleted a couple of lines that centered the text, but deleting is not writing...
Note: I also ran into the following error starting my AVD a few times:
ERROR: Unable to load VM from snapshot. The snapshot has been saved for a different hardware configuration.
This just means you've been messing with your AVD hardware configuration too often. Launch your AVD from the AVD manager with "Launch from snapshot" unchecked and "Save to snapshot" checked, and it should do the trick.



thank you!! you save me.
ReplyDeleteGlad it helped!
Deleteشكراً جزيلاً
ReplyDeleteلقد تم حل المشكلة
thank you
Np -- glad it worked for you
Delete