tag:blogger.com,1999:blog-53390425110071258922024-03-05T18:22:27.555-08:00Android Development GuideWaqashttp://www.blogger.com/profile/00523005563937332645noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-5339042511007125892.post-1698008130081856452011-04-02T16:36:00.000-07:002011-06-17T07:17:52.999-07:00Android Virtual Device (AVD) Emulator stopped working<span style="font-family: georgia;">I have been playing with Android Virtual Device and once I ran the "Hello World" application (read: copy-and-pasted from Android Development Guide) I thought I had conquered the world. My inflated sense of achievement didn't last long before the Android Virtual Device stopped working altogether. I had enough memory available and hard drive was not an issue but still the Virtual Device refused to start without giving much details. I even tried the </span><span style="font-family: georgia; font-style: italic;">best</span><span style="font-family: georgia;"> Tech Support answer and restarted the machine but it didn't work.</span><br />
<br />
<span style="color: red; font-family: georgia;"><span style="color: black;">The Eclipse SDK did not show any specific error message or exit code, here is what the Eclipse SDK console showed:</span></span><br />
<span style="color: red; font-family: georgia;">[2011-04-02 19:16:32 - Emulator] </span><br />
<span style="color: red; font-family: georgia;">[2011-04-02 19:16:32 - Emulator] This application has requested the Runtime to terminate it in an unusual way.</span><br />
<span style="color: red; font-family: georgia;">[2011-04-02 19:16:32 - Emulator] Please contact the application's support team for more information.<br />
<br />
<span style="color: black;">The AVD was working perfectly fine earlier and I didn't remember changing anything that may have broken it. Based on the little information available online specific to this error and AVD, I stopped and restarted <a href="http://developer.android.com/guide/developing/tools/adb.html">ADB (Android Debug Bridge)</a> but that didn't help either.<br />
<br />
I tried launching the Android SDK and AVD </span></span><span style="color: red; font-family: georgia;"><span style="color: black;">Manager from within Eclipse (Window > </span></span><span style="color: red; font-family: georgia;"><span style="color: black;">Android SDK and AVD </span></span><span style="color: red; font-family: georgia;"><span style="color: black;">Manager) and it still didn't start the virtual device. The emulator.exe application would simply not show up in the Task Manager. Then I tried to launch the emulator through commandline and that helped resolve the issue. </span></span><span style="color: red; font-family: georgia;"><span style="color: black;"><span style="font-style: italic;">device2</span> was the name of the AVD.</span></span><br />
<span style="color: red; font-family: georgia;"><span style="color: black;">>emulator -avd <span style="font-style: italic;">device2</span></span></span><br />
<span style="color: red; font-family: georgia;"><span style="color: black;"><span style="color: red;">Failed to allocate memory: 8</span> <span style="color: red;">This application has requested the Runtime to terminate it in an unusual way.</span> <span style="color: red;">Please contact the application's support team for more information.<br />
</span></span></span><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBY9wjI4ve5WNjDLV-eXEKNTG0LMKUl4N4faQyAEGsAp3bziiu7jxawnhylfTiCFd4fnXjTS7FEc6ZwaAnSbGzRjPCOO4-BbQYw38VQjUlYHw8K_piLhNDUyt_E2wSCDvPylTK755AEkyo/s1600/Edit+Android+Virtual+Device+%2528AVD%2529.JPG"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5591141468830129586" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBY9wjI4ve5WNjDLV-eXEKNTG0LMKUl4N4faQyAEGsAp3bziiu7jxawnhylfTiCFd4fnXjTS7FEc6ZwaAnSbGzRjPCOO4-BbQYw38VQjUlYHw8K_piLhNDUyt_E2wSCDvPylTK755AEkyo/s400/Edit+Android+Virtual+Device+%2528AVD%2529.JPG" style="cursor: pointer; float: right; height: 400px; margin: 0pt 0pt 10px 10px; width: 240px;" /></a><span style="color: red; font-family: georgia;"><span style="color: black;">Aha! That reminds me that I had changed the Device RAM from 256 to 1024MB and it had not started successfully after that change.<br />
<br />
<span style="font-weight: bold;">Solution:</span> Edit the Device settings and change the RAM allocation to a lower number. I change it to 512MB and the emulator starts working.<br />
<br />
I wonder why 1GB of RAM was too much for the Android Virtual Device manager to allocate when I have 3GB of physical RAM, 2GB of paging file and the Windows Task Manager was showing less than 2000MB under "Commit Charge" (i.e. more than 3000MB was available).<br />
</span></span>Waqashttp://www.blogger.com/profile/00523005563937332645noreply@blogger.com12