Android emulator infinite loading and errors when GPU emulation is enabled - android-emulator

I have downloaded the entire Android SDK from the official website and I installed a new emulator (Android 4.0.3). As long as I don't have GPU emulation enabled it works (even if it need about 5 minutes to start and then uses a lot of resources) but when I enabled it the emulator enters a loop or something and it never loads. When I look at the Task Manager I see the memory usage growing up until a Windows message displays a warning about the low memory that's left (so, I have to close it).
When I execute "adb logcat" I get this repeating error:
E/EGL/Emulation < 113>: RcMakeCurrent returned EGL_FALSE
E/EGL/Emulation < 113>: tid 114: egMakeCurrent<976>: error 0x3006 <EGL_BAD_CONTEXT>
E/libEGL < 113>: egMakeCurrent:674 error 3006 <EGL_BAD_CONTEXT>
E/SurfaceFlinger< 113>: Couldn't create a working GLES context. checks logs. exiting...
My computer's graphic card is a nVidia 8400 GS 512 Mb, my processor is a 3,2 Ghz Intel, it doesn't support hardware virtualization, I can run WebGL. Maybe this information may be of use for the detection of the problem.
Thanks for your help

Problem was fixed with SDK Tools revision 19
http://code.google.com/p/android/issues/detail?id=28529

Related

Flutter with VS Code and emulator taking too much ram

I just want to ask, im running flutter with vs code and android emulator using my Acer Aspire 3 (Ryzen 5 2500u and 8gb ram 6.9gb usable).
When i run the emulator suddenly my laptop was slow and when i check task manager my ram usage is reaching 98-99% due these Open JDK, vscode, emulator, dart, etc. Is it normal? I saw the requirement on flutter website and i think my spec its not problem. Any one know how to fix this issue?
Sorry for my bad English Thanks in advance.
This is a very common issue that I faced personally. After wasting a lot of time at the slow laptop, I decided to upgrade my RAM & now it works better.
Assuming that a normal Flutter developer uses the following programs at any given time -
Chrome (~1.5 GB)
(Obviously for StackOverflow, Github, Music, Surfing etc. Minimum 5 - 8 tabs open)
VS Code (~1 - 2 GB)
For running project(s) (Sometimes I have to switch b/w multiple projects)
Emulator (~1.5 - 2 GB)
Easily consumes a lot of RAM.
Your OS (Windows/Linux/Mac (~1.5 - 2 GB)
Your OS may consume 1.5 - 2 GB RAM with no programs running. If it is consuming more, then try restarting your laptop.
I have upgraded my RAM to 16 GB now. Now, my normal usage goes to 7.6 GB (around 50% RAM usage).
If you are using Android Studio, then you will have even less RAM. It is really heavy (2.5 GB+, in some cases). I personally use VS Code as it is light-weight.
An alternative can be to use an actual mobile device, instead of an emulator.
My computer with Intel Core i7 - 4770 and 12 GB RAM is much worse.
Android Tablet Emulator used up to 3.96GB RAM. 8 Tasks of Dart.exe used up to 3.6GB of RAM. VSCode only used up 1.6GB. I only open one Flutter project, one Node.js project.
I used the recent version of Flutter 3.04. The computer is so much slow and very lag. I only opened one Edge browser too. I really hope Flutter team can fix this thing. I don't have any budget yet to buy Android tablet for this startup project. Android emulator is my only option.

Android Studio Emulator Error: "deleteSnapshot: for default_boot"

I installed Android Emulator and Google Play Intel x86 Atom System Image (API 28) and configured a AVD, then ran it for first time. The emulator window showed and closed immediately and in Event Log, I see this error:
5:48 PM Emulator: deleteSnapshot: for default_boot
5:48 PM Emulator: Process finished with exit code 0
This error occurs in both Cold and Quick Boot.
I already installed the Intel x86 Emulator Accelerator (HAXM).
I currently use Android Studio 3.1.4.
I tried using Wipe Data and recreating the AVD, but nothing became affected.
What's wrong and how to fix this problem?
Actualy I got similar error often:
`16:22 Emulator: D:\Data\Sdk\Android\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: error while loading state for instance 0x0 of device 'goldfish_pipe'
16:22 Emulator: deleteSnapshot: for default_boot
16:22 Emulator: qemu: unsupported keyboard cmd=0x84
16:22 Emulator: Process finished with exit code 0`
I figured out it is good to make snapshot when you install new device(like google account etc.)
When the error occurrs again, then you need to edit device, Show advanced settings and select Boot from snapshot.
Dude I was having the same problem and solved doing the following:
I accessed Android Studio, went to the list of my AVDs and wiped the data with the "Wipe Data" function.
After that it went back to normal operation.
Hope this helps! = D
I think the problem was with my CPU. So I used Genymotion (that uses VirtualBox), it's much faster than AVD. I repeat it's very FAST. Now, I'm using Android 9 (Pie) on Genymotion.
I recommend Genymotion for those who have problems with AVD.
If there is unused AVD's remove them,then Try to increase RAM size of the emulator and restart your android studio.
In my case Avast was the cause of the problem, I'm solve it deactivating avast's shields for 10 minutes, run the emulator (It runs well again but deleted all the previous apps installed), closed it, close android studio, reactivate the Avast's shield again and run android studio and the emulator works fine again now.

qemu-system-i386.exe has stopped working (only via CLI, works fine when starting via Android Studio AVD)

I've browsed through many topic and answers related to the emulator crashing issue. Yet, I still have no clue how to resolve this issue.
My setup:
Windows 10 x64 laptop - 16GB RAM - Intel Core i7-6820HQ CPU # 2.7Ghz
Android Studio 2.3.3
Java JDK jdk-8u141-windows-x64
HAXM installed and activated
When I open Android Studio, I can start the emulator without any issues.
(see picture here)
But when I try the same from the commandline, the emulator does not startup properly and stops. (see picture here)
I've tried:
HAXM 6.0.6 and HAMX 6.1.3
Graphics: Software GLES 2.0 (instead of auto)
RAM: lowered to 512 (instead of the default 1536) as mentioned in many posts
Try a emulator with lower resulution (like Galaxy S 800x600) as also mentioned in many posts
Use arm image to trigger arm emulator
Add MB behind certain values in the ini file
Set the width/height value to 0 in the ini file
Turn off the camera (front and back) emulation
Disable multi-core CPU (since it mentioned behind it that it's experimantal)
I tried the emulator in the tools folder and the emulator folder
What am I doing wrong here?
What else can I try?
Did I forget a combination of the above mentioned items?
My end goal:
I want to make this emulator part of my CI cycle and for that I need to run a command line (or powershell) script on a Hyper-V machine (in Azure), to start this emulator, so I can hook it up to my selenium-grid (via Appium).
I had the same problem, I fix it by updating my windows (windows 10) to the latest version (windows 10 version 1903 build 18362) and take the optional update (KB4512508)
in the windows update setting..
I'm using:
- Windows 10 Enterprise.
- AMD A10-4600M APU withe Radeon HD graphics.
- ram 512.
Try this solution it worked for me.

Emulator error while starting an avd

I have installed adt bundle for windows(comes up with android 4.3) and have installed jdk7.
But after creating an avd when I start it the below error is displayed.
If anybody can tell where might be the issue and how to fix that I will be thankful
Starting emulator for AVD 'avd5'
Failed to create pbuf surface for FB 0x3004
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
extension WGL_ARB_make_current_read was not found
It seems that this might be an issue of the emulator still being 32-bit as it can't allocate enough continuous amount of ram to the emulator.
The following post suggest various options you can explore:
Disable OpenGLES emulation support by renaming \tools\lib\libOpenglRender.dll to libOpenglRender.dll.disabled.
Reduce the amount of memory used by the emulator. Try 900MB, if that doesn't work, try 800MB, if that doesn't work, try 700MB, you get the idea. (I suggest start with a rather low value of 512 MB)
Typing in the resolution manually rather than picking WXVGA720 or 800
I hope this helps...
Click Edit your virtual device and then unchecke Use Host GPU - I think it will work.

How to make an AVD with > 768MB RAM To emulate Galaxy devices

I am trying to emulate the Galaxy Note 2 which contains 2GiB RAM and some custom hardware like the s-pen and TouchWiz. I created an emulator with 2GB to start with. The emulator won't launch, in fact it is crashing eclipse. I would also like to emulate multi-screen TouchWiz support. I don't see any info anywhere on emulating custom platforms like TouchWiz. Any ideas? I need a decent testing platform for the Galaxy series, but I can't even get basic android working.
edit: The Samsung dev page shows this setup: http://developer.samsung.com/forum/thread/emulator-size-for-galaxy-note-2-/77/178557
Is this a lack of available ram?
using the suggestion of manually adding "mb" behind the memory size in your configuration file (as suggested in this thread: Android: failed to allocate memory ) (located at: %USERPROFILE%/.android/avd/name-of-your-avd/config.ini) has solved the 768mb problem here!
example that now works on my win7 x64 ultimate os -with- dedicated gpu;
avd.ini.encoding=ISO-8859-1
hw.sdCard=no
hw.device.manufacturer=Google
hw.mainKeys=no
hw.lcd.density=320
hw.accelerometer=yes
hw.dPad=no
hw.cpu.arch=x86
skin.name=720x1280
abi.type=x86
hw.device.hash=1197498893
hw.trackBall=no
hw.device.name=Galaxy Nexus
hw.camera.back=none
hw.sensors.proximity=yes
hw.battery=yes
disk.dataPartition.size=512M
hw.gpu.enabled=yes
image.sysdir.1=system-images\android-18\x86\
hw.audioInput=yes
hw.sensors.orientation=yes
hw.camera.front=none
hw.gps=yes
skin.dynamic=yes
skin.path=720x1280
hw.keyboard=yes
vm.heapSize=128
hw.ramSize=2048mb
I have tested this on two machines, my desktop and laptop both running Windows 7 X64 Ultimate
The Laptop has an Intel I7-4702MQ with 12GB ram and GeForce GTX765M
The Desktop has an Intel I7-3820 with 32GB ram and has Ati 6950 in Crossfire and an Nvidia GTX560Ti (normally for physx).
The desktop only has issues in reliably starting the gpu acceleration while using crossfire, other then that i've had no issues with the emulator at all and even managed to assign 4096mb RAM with a 256VM Heap (however increasing the VM-heap above 128 seems to slowdown emulator initiation tremendously here)
On the desktop i also tested the 4096MB setup while even using a RAMDISK but this didn't increase performance too much.
Best settings overall (in my experience) in startup and responsiveness after just a few tests;
2048 with 128mb VM Heap size, gpu acceleration enabled.
Hope this helps out others!
I actually had a similar problem when running on Windows 7. When I relaunched Android studio with administrator privileges it worked. Otherwise I couldn't even open the AVD manager.
This question may be a duplicate of:
Android: failed to allocate memory
I don't presume you would NOT do this, but I'm just going to say it anyway...
Check the details of the correct answer, but especially check the comments for the correct answer.
Seriously, I hope this helps. Android and Eclipse issues have been a problem for me in the past until I learned to crush them with a Zen-like attitude and much exhaustive research and trial-and-error.