I am developing an app on Visual Studio with Xamarin. Yesterday emulator was working fine but it stopped to work suddenly without no reason.
Here is error message from vs console:
Starting emulator my_device ...
C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -partition-size 512 -no-boot-anim -avd my_device -prop monodroid.avdname=my_device
Failed to open /qemu.conf, err: 2
HAX is working and emulator runs in fast virt mode.
C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-i386.exe: error while loading state for instance 0x0 of device 'goldfish_pipe'
deleteSnapshot: for default_boot
emulator: INFO: QtLogger.cpp:68: Critical: UpdateLayeredWindowIndirect failed for ptDst=(1113, 122), size=(300x21), dirty=(300x21 0, 0) (Sisteme bağlı bir aygıt çalışmıyor.) ((null):0, (null))
Go to AVD manager
Try Wipe Data or Cold Boot Now options.
Most of the times, this error is caused when the system tries to draw something like app borders/edges etc and when it fails, it throws following error of UpdateLayeredWindowIndirect Failed
Therefore, it is highly related to graphics, so, try changing your Emulated Graphics in
AVD configuration --> Emulated Performance --> Graphics: Software
Please note that if you are using Google PlayStore API for Android SDK then you might not be able change this setting, therefore, if you are unable to change option of Graphics to Software, please create virtual device without PlayStore
When i run emulator, i get the following error:
Cannot launch AVD in emulator.
Output:
Hax is enabled
qemu-system-x86_64.exe: -drive if=none,index=1,id=cache,file={path_to_SDK}\SDK.android\avd{AVD_name}.avd/cache.img: could not open disk image {path_to_SDK}\SDK.android\avd{AVD_name}.avd/cache.img:
Could not open '{path_to_SDK}\SDK.android\avd{AVD_name}.avd/cache.img':
Invalid argument
Hax ram_size 0x40000000
HAX is working and emulator runs in fast virt mode.
Error accepting connection, aborting
AVD specs are:
OS: Android 6.0 Google APIs
RAM: 1GB
Resolution: 1440x2560
Running on Android Studio 2.0 Beta 6, Windows 10.
Keep an eye out for a background qemu-system-i386.exe process running in the background that will be locking the cache.img file.
This might be still running from a previously failed emulator launch. Kill that using Task Manager and start again.
I had the same problem already twice since I upgraded to Android Studio 2.0 on Windows 10. I use a preferred emulator in the Run/Debug configuration. Changing the Deployment Target Options in the configuration to Target: Show Device Chooser Dialog solved it for me. After choosing the same emulator instance in the dialog it started with no problem. Then I change back to the preferred emulator setting. Until the next time it breaks...
Hoping this helps.
I faced the same problem in Windows 10.
Clearing temp and %temp% folder followed by a restart of machine solved my problem.
I had this problem, when I didn't notice that emulator is already running :)
I'm just install HAXM installer and Android SDK Tools and finally my AVD can launch. But the problem is it stucks on the android. I've been waiting for 20 minutes but it still not yet start up..
emulator: device fd:664 HAXM is working and emulator runs in fast virt
mode creating window 61 83 462 820 emulator: UpdateCheck: current
version '24.4.1', last version '24.4.1'
Device Nexus_5_API_23_x86 [emulator-5554] is online, waiting for
processes to start up.. Device Nexus_5_API_23_x86 [emulator-5554] is
online, waiting for processes to start up.. Device Nexus_5_API_23_x86
[emulator-5554] is online, waiting for processes to start up.. Device
connected: emulator-5554 Device connected: emulator-5554
Is it normal? How long it needs for set up? Have I missed install anything? Thanks
Increase the memory on your emulator.
1.In android studio go to Tools--->AVD Manager
2. then click the edit button (green crayon) and click on "show advanced settings".
Just to add to j2emanue's answer, if you're using command line to start the emulator, you can specify the -memory option. From the emulator -help command:
-memory <size> : physical RAM size in MBs
So you can:
emulator -avd <avd_name> -memory 1024
I am working on automating screenshots capture for one of my apps.
Since I want to capture screenshots of some activities and widgets that differ according to the system locale, I start for each desired language a new Android virtual device (emulator) with the correct properties for setting the system locale. Then, specific user interactions are simulated with uiautomator.
My workflow is working as expected but I have an issue with screenshots capture. Indeed, using UiDevice.takeScreenshot(File storePath) or screencap on the emulator always creates an empty file.
It seems to be a known issue with AVD running with Host GPU enabled (which is my case). The proposed workaround is to start the emulator with Host GPU disabled. Unfortunately, when I start the virtual device with Host GPU disabled, the emulated screen remains black.
I have taken a look at the output of the emulator with the -verbose option and abd -e logcat command (emulator output, logcat output). In logcat ouput I have identified the following error but I cannot figure out the cause of it:
E/SurfaceFlinger( 929): hwcomposer module not found
E/SurfaceFlinger( 929): ERROR: failed to open framebuffer (No such file or directory), aborting
Below is the command I use to start the emulator:
LD_LIBRARY_PATH=$ANDROID_HOME/tools/lib:$LD_LIBRARY_PATH emulator -avd screenshots -skin nexus_6 \
-skindir $ANDROID_STUDIO_HOME/plugins/android/lib/device-art-resources -no-audio \
-prop persist.sys.language=en -prop persist.sys.country=en -verbose -qemu -m 512 -enable-kvm &
I am running Fedora 21 with an Nvidia GPU.
Does someone has succeeded to start an Android virtual device with a recent system image with Host GPU disabled? Any help or suggestion is welcomed.
Holy cow! The problem I am facing is a known issue. Workaround is to use a skin with lower screen resolution (e.g. nexus_4).
I have been having issues running my first android app. Yesterday, i came close to running it but my happiness was dashed when i encountered this error:
emulator-arm.exe has stopped working
What do i do? I want to run this 'Hello World'
My Console Display:
[2011-07-28 10:46:52 - HelloAndroid] Android Launch!
[2011-07-28 10:46:52 - HelloAndroid] adb is running normally.
[2011-07-28 10:46:52 - HelloAndroid] Performing com.bestvalue.hello.HelloAndroid activity launch
[2011-07-28 10:46:52 - HelloAndroid] Automatic Target Mode: Preferred AVD 'my_avd' is not available. Launching new emulator.
[2011-07-28 10:46:52 - HelloAndroid] Launching a new emulator with Virtual Device 'my_avd'
[2011-07-28 10:47:13 - Emulator] emulator: emulator window was out of view and was recentred
[2011-07-28 10:47:13 - Emulator]
[2011-07-28 10:47:14 - HelloAndroid] New emulator found: emulator-5554
[2011-07-28 10:47:14 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2011-07-28 10:47:28 - HelloAndroid] emulator-5554 disconnected! Cancelling 'com.bestvalue.hello.HelloAndroid activity launch'!
Change the resolution of the device and it should work. It didn't work for me when the resolution was 1280X800. I changed it to 800X600 and it worked fine.
After many attempts to fix, I found the following most helpful: Android: failed to allocate memory
Running the emulator with 512mb of ram or less seems to be the only solution so far for me. Thanks
Here's how to fix it and keep your desired amount of RAM:
Go into the AVD folder (example: C:\Users\username\.android\avd\phone.avd)
Open the "config.ini" file in Wordpad.
Modify the 'partition' and 'ram' lines to end in "MB" (See below for the proper syntax changes)
ORIGINAL: disk.dataPartition.size=512M
MODIFIED: disk.dataPartition.size=512MB
ORIGINAL: hw.ramSize=1024
MODIFIED: hw.ramSize=1024MB
Save the file, and then run the emulator again (e.g. "emulator.exe -avd phone"). You must repeat this process for each of your AVDs.
Might be old question but try executing directly from command line, assuming you are in android-sdk\toolsfolder run your created emulator by calling emulator-arm #youremulatorname
After some minutes searching Google and eventually Stackoverflow I finally came across a fix. Only way for reliably generate the crash during my experimentation was changing RAM size to 128 and in fact, many crashes depend on 2 problem:
PC Ram is less or equal to one defined in AVD. You must set it lower depending on your hardware RAM.
Also, some graphic and OpenGL issues found that can be fixed by changing default display to HVGA or setting a lower resolution in AVD.
Good luck!
emulator-arm.exe is not working due dual graphic card. select the basic graphical card not high performance one and is going to work. I have nvidia 555M and as bases Intel. Using intel the emulator starts.
i found tht using the avd manager to delete and recreate the virtual device without checking the snapshot enabled check box while creating the avd works. i found this on google group for android. although this issue hasnt been resolved, this method can be used as a workaround for this problem until this bug is fixed
Two options worked for me:
1. Changing the emulator resolution. I don't know why, but if I change it, it just works.
2. Changind the "Number of emulated web cameras" variable to 0 in AVD.
Thank you very much for the help!!
Marking "Use Host GPU" checkbox worked for me.
Finally solved this for me after trying all the options above. There is a solution at AndroidDevelopers on Google Plus.
If you want to have graphics acceleration enabled by default for this
AVD, in the Hardware section of the AVD configuration, click New,
select GPU emulation and set the value to Yes.
My case was that the skin setting somehow had been changed from WVGA800 to WVGA854 in AVD. After I switch it back, the emulator works.
Go to Window->Open Prespective->DDMS
you will see view as mention below
click on the portion i have highlighted and click on reset adb,and try to run your project again
If you don't see an emulator running, check Task Manager to see if you have an emulator-arm process already running. If there is an emulator-arm process, select it, choose "End Process", and try again.
In my case, I had to set memory RAM from 1907 (default) to 512 to get it working
Use a low resolution device, when I selected Nexus 4 it kept running smoothly with me.
Also worth checking that HAXM is installed/enabled (this fixed issue for me, without it got same error as you were reporting and it slowed my Mac to a crawl).
Just rebooting my PC worked for me.