Unbearably slow android emulator -- is there a fix? - android

I know that the topic was discussed here last year, but I am hoping that someone has since found a fix. The emulator is simply not working for me anymore. It took 15 minutes or so to load hello world a few days ago, and now I can't get it to load a simple MapsDemo from the api samples no matter how long I wait.
I'm using eclipse with the android plugin (sdk and avd manager). My pc is 2.31 GHz quadcore with 8GB ram and windows 7 x64. Nothing is being logged in LogCat apparently.
Are there any alternatives or certain fixes I can try before buying a phone? I'd just upgrade my phone to an HTC Incredible and debug from the phone, but Verizon won't have any for at least a month and I'd really like to have my app out by then.

The best advice I've received is to use to target an older platform and a lower resolution. The emulator for Android 1.5 at HVGA is significantly faster to load than 3.1 at tablet resolution.
If you are running an emulator for a newer Android version, and want to see what it is doing while loading, you can watch on 'adb logcat'. It at least gives some better feedback than the word "Android" with a light shining across it!

Delete all your AVDs & re-install the SDK in a new directory. This should clear out any lurking config settings or AVD based issues which could be causing the slowdown.
Also try shutting down any virus/spyware scanner you may have running because you can then see if your AV app is trying to scan the AVD and or SD card images which could slow things down.
(btw, I'm running the emulator on a Quad Core Q6600 with 4gb RAM & Win 7 x64 and it starts in less than 1 min, so I doubt it's a compatibility issue).

I usually start it then after I see the "ANDROID" screen close it and restart it and it works and starts up a lot faster the second time.

I have started using ubuntu v11 (with dual boot) ,emulator is now starting within 40sec and working without any errors ,which i have encountered in windows 7 and performance is also good.

I just had the very same problem today, after I received the advise, to create a 400MiB SD Card on my AVD. I did so, but nothing worked anymore. I waited half an hour for my App to compile, but nothing happened even though the LogCat was still runníng ... So I came in here to find a solution and I did!
Here`s what speeded the whole thing up again:
I went to the AVD Manager (Window > AVD Manager in Eclipse)
Above the AVDs you can see the path where everything is stored that is created by the machine
So I went to that folder of the path and it was filled with previously compiled stuff
So I deleted it and voila, my App is run within a minute again!
P.S. It might be the case, that you won`t find the last folders described in the path, because they are hidden. Just type in that path, and they will be there: The hidden folders looked like this: .android\avd
Just type it in manually and erase all that stuff in there.

Using SDK Manager download and Install Intel x86 Emulator Accelerator(After downloading this SDK Package can find executable file at path "SDK_LOCATION"\extras\intel\Hardware_Accelerated_Execution_Manager Install it) and also Intel x86 Atom System Image packages.
Then create a new AVD with CPU/ABI as Intel Atom(x86), and Check Use GPU Host. Done!

Related

Android Emulator closed because of an internal error: GPU Found

I haven't been on Android Studios in a number of days. When I went back on my emulator kept getting killed. I deleted all my emulators and the AVD manager folder in .android. After selecting that the emulator graphics be Software GLES 2.0 the emulator works and can run the application but it is very, very slow. Only a week ago the emualtor and Android Studios worked great.
I am receiving this error messaging now after re-installing an emulator with API level 28 (Pie):
Answer that work [28. July 2021]
First of all update your graphic card with the latest driver. (Graphic Card Model can be checked through your Device Manager)
Type in your explorer the following path, where <pc_name> need to be replaced with your individual name:
C:\Users<pc_name>.android
In the above mentioned directory we will put a .ini file that I prepared and is ready to download here. This file will disable your Vulkan driver and enable your GLDirect driver that your AVDs don't lag anymore. (watch image below)
Start your AVD and you will be able to use it without any troubles.
There is a missing or corrupted file amdvlk64.dll.I fixed this by given steps.
Download amdvlk64.dll from This Link , this is for 64 bit OS, you can search fro 32 bit also.
After Download, extract the folder on your desktop.
Open Extracted folder and Copy the amdvlk64.dll file.
Now Paste this file in C:\Windows\System32
Again run the emulator, hopefully it will run.
In my case I resolved this by performing the pending SDK Tools updates in the SDK Manager.
Reference : https://superuser.com/a/1583394/961460
I get this error (Emulator is closed because of internal error: gpu found)
suddenly while I am running my code. So how I solve the problem is,
Go to AVD Manager or (Virtual Device Manager).
Edit your AVD or (Virtual Device Manager).
Select 'Software GLES2.0' option on Emulated Performance.
Click Finish.
Start AVD again
Download and install this vulkan-dll driver.
There are those who think that the comment I added is a virus, I researched the subject a lot and finally reached the address, almost 48 hours later, so I installed my emulator, my aim is just to help.
For me, the same error showed even though I have NVIDIA GPU.
Restarting the system after the NVIDIA driver update fixed the problem.
I installed Android studio in Windows 10(AMD Ryzen), the following one helped me to run the emulator smoothly. Once you installed Virtual device from AVD manager successfully, then your emulator will popup the above error like Android emulator closed....amdvlk64.dll not found and amdvlk32.dll not found.... when you try to run your code. Just follow this steps to avoid those error, hope it works:
Close your Android studio and also emulator error popup. Go to
Control Panel.
Select Programs --> Programs and Features --> Turn windows feature
on or off (which lies in the extreme right side of the screen).
A popup appears, in that check the Windows Hypervisor Platform and
Virtual Machine Platform, then click Ok.
It ask you to restart your system, allow to restart.
After restart, now open Android studio and run your emulator, hope it will
run smoothly.
At times the error might be caused by the wrong system date/time set on your computer. Try updating the system date/time and restart the android emulator. In my case it was caused by the wrong system date/time.

Starting AVD Emulator always gives "Android Emulator Closed unexpectedly"

My sincere thanks for your reading this.
I have just installed Android Studio and am attempting to run the default Hello World! script that is present when you create a new project.
Every time I try to run the the program in an Android Emulator my Emulator crashes and I get the error "Android Emulator Closed Unexpectedly" Every. Single. Time.
I have the Intel x86 Emulator Accelerator (HAXM installer) installed as suggested:
I try to run a Nexus 4 emulator with 512 mb of Ram and it never works:
When I run this I get:
During this, my system physical memory peaks at 80% but never goes to 100 (which I would expect if it were crashing).
I have searched similar questions including
Android emulator crashing on Windows 7 64 Bit Android 4.0 emulator always has a crashing Launcher? Android studio emulator fails to start with memory limit related error message and they say to lower the memory size (which is what I am trying to do). Unfortunately this isn't working
Any idea how I can solve this issue?
My computer specs are as follows:
64 Bit Windows
6gb Ram
Intel Core i3
I downloaded and installed all correct versions as instructed here: https://developer.android.com/studio/install.html
In my case, this issue took the whole weekend to solve.
All options I tried, until:
Android Development Studio prompted me to update the Android Emulator Version to 25.3.1 (no idea what it was on before as I didn't check this before). This was a download of ~170mb.
Once I downloaded and installed the update, the emulator now seems to run OK on low memory settings - settings in keeping with the answer to this question here: Android emulator generates a very annoying error
I am now running with settings:
RAM memory to 5012
Virtual heap 32
Internal storage 200 mb
External storage 64 mb
So basically, it was a complete fluke that this worked.
To anyone that gets this error after rooting the android image, (if using snapshots). You need to start the virtual device with the -writable-system parameter like when you rooted the device, excerpt from docs.
Snapshots
...Starting a virtual device by loading a snapshot is much like waking a physical from a sleep state, as opposed to booting it from a powered-off state.
I was also having the same problem, Every time I was starting Emulator, it was closing unexpectedly. then I tried to change the Emulator Performance in settings of AVD Managers; In Software it's not working but in Hardware it was showing blank black screen.
Then I realized, there might be some issue with Graphics Card(mine NVIDIA GeForce 940MX), It was showing this error
After Updating/Restarting the problem was not resolving, then I Disabled then Enabled the Graphics Card Driver in the Device Manager and It worked!!😊
LONG STORY SHORT: Check, the problem might be due to your Graphics Card!😐
in my case, i attempted using gennymotion [ you may install it asking google genymotion . com] this could serve as alternative.
if gennymotion after installation returns this error message "the version of openGl supported by your graphics card is too old:Genymotion requires at least openGl 2.0 support. "
then know our challenge is arising from not having required graphics driver
either you checkout this link [https://buffered.com/support/solve-opengl-error/] on how to resolve it in steps.
or you download the graphics drivers using the links below
Here are the links to the 4 most prominent graphics card manufacturers in the world:
Intel: http://www.intel.com/content/www/us/en/support/detect.html
restart your systems after installation of the appropriate graphics driver and continue your project .

Android Studio Emulator not starting

Because the emulator was really slow I installed the intel x86 emulator. I changed the settings in my emulator (ARM to intel atom). Now when I run a project it takes me to the emulator selection screen and when I select it, the project starts running, but the emulator doesn't pop up.
I tried switching the cpu back to ARM, but it still doesn't work.
When I close Android studio it asks me if I want to disconnect from the project so I'm sure it is running.
I came across a few posts that said to give the device 768 ram, but that didn't work.
Anyone knows a solution?
I was facing the exact same issue, but for me reducing the device RAM to 768 did fix it. Therefore I'd suggest continuing to decrease the RAM values and trying to launch it.
How about to use Rock speed Emulator - Genymotion?
I know it sometimes take time to launch emulator and launch app in emulator too. But it depends on your configuration of your PC and settings you have done in Eclipse or Android Studio.
For example: You may have kept "Build Automatically" ON and it sometimes slow down running time.
My current rep is not high enough yet to comment on another answer, so I am adding a new "answer" to +1 Paresh Mayani's answer to use Genymotion. I only recently discovered it and found it to be much much faster than the emulator. Instead of emulation it runs an Android rom in a VM using VirtualBox. I've found that it runs full speed on my machine and is just as fast in debug mode as normal mode, which is impressive since even my Nexus 5 struggles when connected to a debugger.
In my case also x86 was creating problem, I installed Android 5.0.1 armeabi-v7a and have set 768MB as RAM size and it worked.
Try to check and run the emulator ie. store a snapshot for faster startup...
I have tried that by checking the button and works fine.
If you're using an AMD machine try using the "ARM EABI v7 system image". For an intel chip use the "APIs Intelx86 Atom system image". Also, try a different tablet from the Android Studio settings e.g(Nexus 6), as the API level might not be supported from in the Nexus5 VM. You will also have a little wait time for the android emulator, mine takes about 7mins

Why emulator is very slow in Android Studio?

I just setup Android Studio on my PC, which is new launch to develop Android application.
My problem is that, when I try to run my small app in emulator, it take to much time to launch and after then emulator is working slow too.
AVD settings
AVD Name: Glaxy
Device: Glaxy Nexus (4.65", 720x 1280: xhdpi)
Target: Android 4.2.2 - API Level 17
Memory Option: Ram 500, VM Heap 64
Internal Storage: 200MiB
I have good window pc: Intel Core 2 Duo 2.93Ghz and Ram is 3gb
I am new in Android development and java.
The Best Solution is to use Android Emulator with Intel Virtualization Technology.
Now if your system have a Processor that have a feature called as Intel Virtualization Technology, then Intel X86 images will be huge benefit for you. because it supports Intel® Hardware Accelerated Execution Manager (Intel® HAXM).
To check that your processor support HAXM or not : Click Here
You need to manually install the Intel HAXM in your system. Follow these steps for that.
First of all go to - adt -> extras -> intel -> Hardware_Accelerated_Execution_Manager
Make sure that Intel Virtualization is enabled from BIOS Settings.
Now install Intel HAXM in your system and select amount of memory(i prefer to set it as default value).
After installation create new Android Virtual Device (AVD) which should have a Target of API Level xx
Now set the CPU/ABI as Intel Atom(x86).
If you are on Windows then do not set RAM value more than 768 MB while setting up an emulator.
Run the emulator. It will be blazing fast then ordinary one.
Hope it will be helpful for you. :) Thanks.
Just edit the AVD settings as below,
Enable snapshot options and please use INTEL HAXM software for speedup.just visit https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm and download...
I tried all the suggested remedies and none had any impact. The Android Studio emulator experience was simply unusable with my setup (Windows 10, AndroidStudio 3.5, Quadcore 3.2 Ghz, 32GB with SSD drive).
I tried Updating Studio, Installing Intel HAXM, Changing the memory settings via SDK, using an actual device, excluding the various folders from in the Windows Anti-virus among other things.
The solution that made it work like a breeze was to exclude the Android Debug Bridge (adb.exe) "as a process" from the Windows Security / Virus Protection. You can either do it yourself or read the details below to know how to do it.
I suggest verifying the severity of the speed issue yourself. The same will be used to verify the difference immediately after you apply the remedy. Running the options from within Android Studio just makes it more complex.
Steps to check the issue:
Get the path for your Android SDK Tools. You can find it from SDK Manager -> Appearance and Behavior -> System Settings -> Android SDK.
Open a command prompt or terminal window. You can do right click on Windows (Start) Icon -> Run and execute "cmd". This should give you a windows command prompt or terminal window.
In the terminal window, change your drive and path to your Android SDK folder using the CD command. Now change to the sub-folder Platform-tools.
You will find the Android Debug Bridge (adb.exe) in this folder. This plays a very crucial role in operating the emulator as well as the actual device.
In the terminal window, execute the adb.exe tool with the command adb. It should instantly return back with the help parameters for adb.
Now execute adb.exe with a command like - adb devices. This should simply stall and take several seconds to come back with the information even if you have no devices or emulator running. In my setup it took almost 30 seconds. This is the issue.
Anything you do with the emulator goes via adb and gets stuck here. Once the remedy is applied, it should execute the adb devices command as instantly as the simple adb command without any parameter.
Steps to remedy:
Go to Windows "Virus and Threat Protection" setting. There are several ways to reach it. You can use Right Click on Windows (Start) Icon and choose Settings. Choose Update & Security, then Windows Security, then Virus and Threat Protection.
You will find the option Virus and Threat Protection Settings. Select it. You will find several options, look for Exclusions. Select the option Add or remove exclusions. This will take you to the list of Files, Folders, Processes which are presently excluded by the windows anti-virus. It may be empty or may have some data.
Select "+ Add an Exclusion". You will find 4 options - File, Folder, File Type and Process. This is critical. Please choose Process.
In the "Enter Process Name" input box type in the name adb.exe. Please dont forget to type in the extension, just putting adb will not work. Accept the input with "Add" button.
You are done. Now goto the command prompt again and follow the same steps you did earlier to check the issue. Hopefully you will be pleasantly surprised and your entire Android Studio emulator experience should become seamless.
Note that the steps may slightly vary depending upon your version of Windows, Android Studio and SDK tools however it should still apply.
The new Android Studio incorporates very significant performance improvements for the AVDs (emulated devices).
But when you initially install the Android Studio (or, when you update to a new version, such as Android Studio 2.0, which was recently released), the most important performance feature (at least if running on a Windows PC) is turned off by default. This is the HAXM emulator accelerator.
Open the Android SDK from the studio by selecting its icon from the top of the display (near the right side of the icons there), then select the SDKTools tab, and then check the box for the Intel x86 Emulator Accelerator (HAXM installer), click OK. Follow instructions to install the accelerator.
Be sure to completely exit Android Studio after installing, and then go to your SDK folder (C:\users\username\AppData\Local\extras\intel\Hardware_Accelerated_Execution_Manager, if you accepted the defaults). In this directory Go to extras\intel\Hardware_Accelerated_Execution_Manager and run the file named "intelhaxm-android.exe".
Then, re-enter the Studio, before running the AVD again.
Also, I found that when I updated from Android Studio 1.5 to version 2.0, I had to create entirely new AVDs, because all of my old ones ran so slowly as to be unusable (e.g., they were still booting up after five minutes - I never got one to completely boot). As soon as I created new ones, they ran quite well.
Check this: Why is the Android emulator so slow? How can we speed up the Android emulator?
Android Emulator is very slow on most computers, on that post you can read some suggestions to improve performance of emulator, or use android_x86 virtual machine
As #Xavi mentioned, Android Emulator is normally slow and lags a lot. Either test your app on an actual device or use an alternative emulator such as BlueStack or Android-X86.
Another tip for using emulator is to not close if you ain't done testing your application. Just leave it open. In this case you skip the time it takes to launch.
Use x86 images and download "Intel Hardware Accelerated Execution Manager" from the sdk manager.
See here how to enable it: http://developer.android.com/tools/devices/emulator.html#accel-vm
Your emulator will be super fast!
The emulator is much much faster when running on Linux. In Ubuntu 13.04, it launches within 10 seconds, and it runs nearly as smoothly as on a physical device. I haven't been able to reproduce the performance on Windows.
EDIT:
Actually, after the first boot, when using the Atom arch. and GPU acceleration, the Windows emulator runs nearly as well as in Linux.
Try increasing your ram of intel HAXM by reinstalling it..
Worked for me..
In my pc HAXM setup's location was here:
C-Users-Pc's_name-AppData-Local-Android-sdk-extras-intel-Hardware_Accelerated_Execution_Manager
Check this list:
install Intel HAXM
just use x86 AVD
use small size screen
I tend to load AVD through snapshot which can be setup in the AVD Manager > Choose AVD > Details... > Checking Emulator Options: Snapshot, and then to run the AVD, Select AVD in AVD Manager > Start... > Select Save To Snapshot and Launch from Snapshot. The first time, ensure that save to snapshot is chosen, as no snapshot exists to launch. The next time onwards choose launch from snapshot.
Slightly apprehensive to suggest this as well, but I have noticed a peculiar behavior when loading and running AVD. When I have the laptop battery being charged on my Lenovo laptop - 64 bit Windows 7, 4GB, 2.5GHz machine, the emulator loads and runs slightly faster and also lags less. I wonder if it is the configuration on my laptop to slow down high computational processes. Would be nice to know if someone else has noticed this behavior? Unplug the charger when the AVD is loaded and see if the AVD slows down.
A quick fix if using Android Studio (or Eclipse) is to disable the boot animation.
1) Select Run > Edit Configurations
2) Android Application > YOURAPP
3) Select the "Emulator" tab and check the "Disable boot animation"
This is will stop the "ANDROID" image from loading and boot directly to the lock screen, then keep your the emulator open. Also, to avoid problems, don't rotate the device before launch (Cmnd + Ctrl + F11), and don't try to run the app more than once during installation.
Android Development Tools (ADT) 9.0.0 (or later) has a feature that allows you to save state of the AVD (emulator), and you can start your emulator instantly. You have to enable this feature while creating a new AVD or you can just create it later by editing the AVD.
Also I have increased the Device RAM Size to 1024 which results in a very fast emulator.
Refer the given below screenshots for more information.
Creating a new AVD with the save snapshot feature.
Launching the emulator from the snapshot.
And for speeding up your emulator you can refer to
Speed up your Android Emulator!:
Try using another android virtual device. You can create one by adding a new device by going to the AVD Manager. Select the screen size 3'2 and API-10 (gingerbread).
This worked for me, and it is super-fast now.
P.S.- My laptop used to take forever to load the emulator, and It never got started due to insufficient memory(4.2). I used to get restart again and again. This solved my problem.
Google Launches Android Studio 2.0 With Improved Android Emulator And New Instant Run Feature
New Features in Android Studio 2.0 :
1.Instant Run: Faster Build & Deploy
You can quickly see your changes running on your device or emulator.
Enable Instant Run follow this steps:
1.open Settings/Preferences
2.go to Build, Execution, Deployment
3.Instant Run. Click on Enable Instant
Please see this video of Instant Run --> Instant Run
2.GPU Profiler
For developers who build graphics-intensive apps and games, the Studio now also includes a new GPU profiler. This will allow developers to see exactly what’s happening every time the screen draws a new image to trace performance issues.
click here for more details about the GPU Profiler tool
Getting Started Guide for Android Emulator Preview
For more detail about android 2.0 Biggest and best update of 2015 you can see very good article Author by #nuuneoi :
First Look at Android Emulator 2.0, the biggest and the best update yet in years
In my case, the problem was coming from the execution of WinSAT.exe (located in System32 folder). I disabled it and issue solved.
To turn it off:
Start > Task Scheduler (taskschd.msc)
Find Task Scheduler (Local)
Task Scheduler Library
Microsoft > Windows > Maintenance
Right click WinSAT
Select disable.
The Reference
Also, suppress it from Task Manager or simply reboot your machine.
Point: In this situation (when the problem comes from WinSAT) emulator works (with poor performance) when you use Software - GLES 2.0 and works with very very poor performance when you use Hardware - GLES 2.0.
Aside from what everyone has already said about HAXM and other configuration settings as solutions for this problem, my solution had nothing to do with software configuration or processor limitations.
I setup Android studio on an older HDD and I had Visual Studio running an android emulator on an SSD. My bottleneck was the old HDD - the SSD I had resulted in more speed.
The solution - albeit not the best for you - is to look in installing an SSD. This is not a very feasible solution in 90% of the cases but for me the root cause was linked to my hardware - not my software config.
Hope this helps another person facing a similar problem!
This worked for me. My size on disk was just too high for the emulator to run correctly. Wiping the data took it from 4.9 GB to 2.9 GB.
Click on the AVD manager at the top right and it will pull up a screen with all your devices. In row with your device the very last icon will be a drop down arrow, click it. Click 'Wipe Data' then 'Cold Boot'
For those who enabled HAXM and the emulator still works slow here is what you should do:
If Avast antivirus is running on your computer, it is most likely the culprit.
as per HAXM Release_Notes.txt (Version 7.5.2):
On Windows, Avast Antivirus may interfere with HAXM and cause Android Emulator or QEMU to run very slowly. A workaround is to uncheck "Use nested virtualization where available" in Avast Settings > Troubleshooting.
So open your Avast dashboard > Menu > Settings > Troubleshooting and disable "Enable hardware-assisted virtualization"
Give a higher priority to your emulator's process in the Task Manager:
Locate your emulator's process in the Task Manager > Details tab:
Right-click on it and Set Priority -> Above normal
Sorry that the screenshot is not in English but you got the point, right?
That helped me significantly! I hope it will help you as well.
Also, one thing as per the Release Notes:
On Windows 8, 8.1 and 10, it is recommended to disable Hyper-V from Windows Features in order for the HAXM driver to properly function.
In my case, I didn't have any "Hyper-V" feature on my Windows 8.1 but you probably should try it, just in case. To locate and disable that feature see this article: https://support.bluestacks.com/hc/en-us/articles/115004254383-How-do-I-disable-Hyper-V-on-Windows-
This is probably because incomplete files in your sdk . Sometimes firewall of ur office or somewhere blocks it and hence error message comes saying peer not authenticated I was facing the same problem but after downloading all the files by getting firewall access
My emulator is working properly and much faster than before

(undetailed) Panic while creating Android Virtual Device (AVD)

Programming newbie, just getting started with all of this...
I have searched around, but I haven't found anything relevant to my problem
So here it is,
So I'm trying to build a simple hello world application for android, but I wanted to test run the AVD just to check things out.
But I get this problem:
(it just shows "PANIC: Cannot create AVD", no further info)
I have tried creating virtual devices based on 4.2 and 2.3.3, but none of these start up.
I have sdk up and running, no problem.
I also have all the files required (like the system images etc)
Eclipse 64-bit also runs fine (had some errors, but solved them using search)
Any help?
I run windows 7 64bit, 500gb hdd, 4gb ram, i3#2.4ghz
SDK, Java, Eclipse and all other tools are 64bit based.
Please help.
If the emulator takes up too much time to load or getting lags then you should try this. Called as Intel Virtualization Technology with HAXM.
I know this is not the answer of your question but that might be helpful for you. :) It can greatly increase emulator speed.
You can check : Here
If you are on windows, make sure that the amount of RAM the AVD will have access to is 512MB or less. It doesn't matter how much RAM your computer has, this is a bug.
What happens when you run the following from shell/command prompt? This should give you more information when the emulator is launching and should help diagnose the issue.
emulator -verbose -avd <name of emulator>
Okay, I seemed to have solved my problem
What I did was copy the default .android folder (it was auto generated in D:.android) to C:\Users\Administrator
Although this just works for one launch
For every subsequent avd launch, I had to re-copy the folder and replace only the edited files
Thanks everyone for trying to help!
You must establish (from security or from the advanced properties of your PC) the local variable ANDROID_SDK_HOME to your docs folder.

Categories

Resources