The Android Emulator 2.0 freezes some time after GPS is enabled.
The Android part completely freezes, the "control GUI" panel still works (but obliviously no effect to Home etc).
adb lists the emulator but no response for adb logcat etc.
The emulator must be closed with ctrl-alt-del. Next freeze comes faster. Instead of occurring within a minute, it occurs within tens of seconds. The PC must be rebooted to get back to a minute.
I want GPS and pressure sensors so GENYmotion and Visual Studio emulators are not an option.
Windows 10 Pro 64bit (before/after Anniversary Edition)
8GB RAM, Intel i5-3570, 30GB available on the Windows disk
Intel HAXM 6.0.3
Occurs for x86, x86_64, arm. Primarily been using Android 7.0 emulator, similar for older versions.
Also occurs with fresh AVD
Default settings for emulators (have tried deactivation multi-core, give more RAM etc)
AVD launched from AS 2.1.2 and 2.2beta1
Nothing seen in system logs, AS logs though: C:\Users\.AndroidStudioPreview2.2\system\log\threadDumps-20160814-103215-AI-145.3128856\freeze-20160814-120115-75\threadDump-20160814-120226.txt Cannot make out something from the logs.
Google has released an update and closed the issue.
Working for me.
Related
I have multiple emulators provided by Android Studio. I have a Pixel 3 and a Pixel 4 both running Android api 30. Both work fine for a while, but eventually there is this popup:
After this point, the emulator becomes unusable. Notice that the home and back buttons at the bottom of the screen are gone. The emulator glitches horribly, with animations slowing down and leaving residue on the screen.
What I have tried
Quitting the emulator application and turning it back on again. Same issue again.
Pressing the emulator power button and restarting the emulator like I would a physical device. Same issue.
Deleting the emulator and creating new one. This works for a while but eventually the error happens again.
I followed the advice here: Android emulator error: "System UI has stopped"
The .ini file had no entry for hw.mainKeys so I tried adding it. No effect.
Stats
MacBook Pro (16-inch, 2019)
processor: 2.6 GHz 6-Core Intel Core i7
memory: 16 GB 2667 MHz DDR4
graphics: AMD Radeon Pro 5300M 4 GB, Intel UHD Graphics 630 1536 MB
Android studio 4.4.1
At this point, it's becoming difficult to continue development, since I have to keep recreating my emulator and reinitializing the device data that I need for testing.
The fixes reported by some users are in the following list. However each of the fixes have worked only for some small group of users.
Update your HAXM version (check manually in SDK manager)
Use a lower resolution emulator
Try a different API version or system image
The only fix that works for all users is to wipe your emulator and start it again (which means setting up your accounts again). This fixes it for short times but the problem always returns pretty fast.
The problem has been common since at least late 2017, on both windows & mac. There was a starred issue on Google bug tracker too but I cannot find the related question on StackOverflow which linked to it
This has been posted here in StackOverflow several times, but unfortunately I cannot get any solution from previous posts to work. When starting the android emulator, it hangs and shows a black screen. I have tried launching it from both Visual Studio and from AVD Manager. Things I have tried:
Waiting for over 10 minutes
Using both Hyper V and HAXM
Changing the Emulated Performance to both Hardware and Software
Changing the config.ini for the device to enable/disable GPU
Changing the config.ini for the device to different GPU modes (i.e., host)
Changing the amount of RAM
Reinstalling ADV and Android SDKs
Quit Forwarding in ADB
Deleted and recreated the device (and several others)
"Wiped Data" in ADV. Factory reset in Visual Studio
Ran from Cold Boot
Tried running from both x86 and x86_x64 devices (Google API and Google Play)
Disabling antivirus and firewalls
Other notes. This is a brand new PC with Windows 10, 16 gb ram, i7 processor, NVIDIA 2060 graphics.
I am out of ideas. Please help.
Well I created a new AVD from AVD manager that is "Nexus 5x API 25". When I Launch the AVD in emulators it gets launched and stay for while (30 Seconds) and Shutdown Automatically.
I tried editing the Ram Size in Config.ini of AVD, but still the same problem.
My computer Configurations are:
Intel Core i3
Ram Size: 4 GB
HDD: 500 GB
Solution.1
By setting the Graphics option on the Android Virtual Device to Software instead of Automatic or Hardware. Once you did that the emulator device started up great and everything worked.
Or
Go to Menu->Tools->Android and uncheck the option Enable ADB Integration Run the application. Now the emulator will be launched, but app will not run. Once the emulator is fully launched, check the Enable ADB Integration option and re-run the app. Now the app will be launched in the already running emulator.
My Android emulator was shutting down almost as soon as Android Studio started it.
I went to the Android Virtual Device Manager and under "Actions" for the misbehaving virtual device, I selected "Cold Boot Now". This seemed to resolve my problem.
I am using Android Studio 3.1.4.
I'm in the same boat with a late 2019 version of Android Studio (v3.5.2), and I've been using it a couple of years, so it seems like a new problem to me. I am able to resolve it by either 'wipe data' (undesirable, often) or 'cold boot' (from tools->avd manager) and then running the app. However, this is not a permanent solution, because it always comes back. I usually wind up doing the cold boot thing once, then be careful not to close the emulator while I am debugging so it is good until next session.
I will note i noticed Android Studio was HIGH on memory usage (which is more difficult to notice in SSD times, because you don't "hear" the hard drive thrashing from swapping memory.) Android studio itself noticed the abnormally high memory usage and reported this to Google (presumably). I wonder if low physical memory is/was the issue.
Update: I just had a BIOS update for my notebook, and afterwards, I do not seem to have the same problem. It is not clear if there was a BIOS problem (virtualization, which emulator uses, is a BIOS option) or if it was just the reboot which temporarily cleared up memory (my original guess).
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 .
I have a new machine running Win 8.1 x64, fully patched, with the latest Android SDK and Java JDK. I installed the latest Intel HAXM package as well. Everything fired up and worked great. The emulator would boot in about 30 seconds and each time I'd run an app from Android studio it would start up over there pretty quickly. But then I closed the emulator window (the UI itself showing the virtual phone). After that, I could never get it to come up again unless I rebooted. After a reboot it again works fine the first time, but never again after I close it. I have tried the following:
Running automatically from Android studio as well as launching manually from the command prompt using Intel's recommended options. Same problem either way.
Killing the emulator-x86.exe process, closing Android studio, unloading the Intel HAXM driver and then restarting all of that. No luck.
Running adb kill-server. No luck.
When creating the AVD I tried both the x86 and x86_64 versions, same result either way.
And yes, I have several real devices that work fine to test with. This is just perplexing that everything works perfectly the first time, yet something is hanging around messing up any further launches until a reboot occurs.
Any ideas on what is causing this or how to go about debugging it further?
-JT