6

Every time I run the emulator it runs normally at the beginning but after a couple of minutes it crashes and it's giving me this error:

emulator process finished with exit code 1073740791 (0xC0000409)

I am using windows 10 home edition. virtualization is enabled in bios. I don't have any other virtualization software installed (like virtual box).

any idea why this is happening?

Zoe
  • 27,060
  • 21
  • 118
  • 148
khayat
  • 133
  • 3
  • 11
  • @Mr.AF ??? not the same error, not even the same OS – Tim Nov 22 '19 at 08:44
  • I should add that for me the emulator never even completes booting. It crashes 2 or 3 seconds after starting – Tim Nov 22 '19 at 08:45
  • @Tim you are right . – A Farmanbar Nov 22 '19 at 14:37
  • maybe check logcat? `adb -e logcat` – Elias Nov 22 '19 at 15:42
  • If your emulator used to work, maybe the cache is messed up? Or user data? There are flags to disable/reset the emulator when starting it such as `emulator @EmulatorName -no-cache` or `-wipe-data`. Also if you don't have enough time to attach `logcat` you could specify an out file with `-logcat-output ./myLog.log` – Elias Nov 22 '19 at 15:58
  • @Elias actually this is the fist time trying to run an emulator on this PC – Tim Nov 24 '19 at 19:47
  • @Time and the logcat output? – Elias Nov 25 '19 at 07:05
  • @Tim: Please try 2 things. 1) set your graphics option to software only , there might be issue with your graphics error, 2) try to uncheck multicore cpu – Mustansar Saeed Nov 26 '19 at 15:07
  • @MustansarSaeed what graphic options do you mean? And where is the multicore checkbox? I'm not on my PC right now – Tim Nov 26 '19 at 15:35
  • @Tim: In `Emulator` advanced settings – Mustansar Saeed Nov 26 '19 at 15:37
  • @MustansarSaeed nope can't change those options – Tim Nov 26 '19 at 22:12
  • @MustansarSaeed I created a different AVD that does allow me to set software graphics, however the same error occurred when I tried to run that one – Tim Nov 26 '19 at 22:24

6 Answers6

2

It seems a buggy graphic card driver can cause a similar problem. I am not sure if this is generated your problem here or not, but it is worth to say; If you have an NVIDIA graphic card with the driver version of 378.49 (there may be other versions too!), you may experience this error due to some incompatibility with java.
Please update your graphic card driver or rollback it to version an older stable version and try again!. And read here for more information.

  • I do have an nvidia card but that faulty driver is 3 years old. I have the latest 441.41 driver. Rolling back to 2017 is not an option – Tim Nov 26 '19 at 22:21
  • I am not saying you should roll back to a 2017 version, just try the version 425.31 for instance. Also, I am not sure if only a faulty driver can generate this problem. There may be other sources that can cause this problem. – Farhad Rahmanifard Nov 27 '19 at 05:38
1

I might have an Idea what your problem is:

Restart the adb Server, you can do so by using the command Prompt in the following way:

First go to C/users/(YOUR USERNAME)/AppData/Local/Android/Sdk/platform-tools with the cd command. Then just type adb kill-server, and adb start-server, so like this;

cd C/users/(YOUR USERNAME)/AppData/Local/Android/Sdk/platform-tools
adb kill-server
adb start-server

If that doesent work try to wipe and cold boot described in this question.

0

Try this :

Go to Tools ==> SDK Menager ==>Android SDK

(Appearance&Behavior=>System settings=>Android SDK)==>SDK Tools==>Intel x86 Emulator Accelerator(install this).

It will solve your problem.I hope it helps.

Prakash Reddy
  • 944
  • 10
  • 20
0

Here are a few things you can try:

  1. Go to AVD manager and open settings for your virtual device. In the Emulated Performance section for graphics, change it from automatic to software.
  2. Have a look at here. There could be an incompatability with other software incompatibility with other software such as Docker, Oracle Virtual Box and other products that use VCPU.
  3. You could try a complete reinstall of Android Studio and make sure all updates are completed. There could be a bug in an older version of the emulator you are using that's fixed in a more recent release.

Edit

A couple more things you could try:

  1. Open Android Virtual Device Manager, then click on options for virtual device, then wipe data, then cold boot.
  2. Go to C:/users/(username)/AppData/Local/Android/Sdk/platform-tools in a terminal, then type adb kill-server, then adb start-server.

Edit

You could also try checking for memory leaks https://developer.android.com/studio/profile/memory-profiler and you could try increase the amount of RAM available for the emulator.

Go to Tools->Android->AVD Manager, then edit your AVD, then in the pop-up window click Show Advanced Settings, then finally increase the amount of RAM.

Edit

IT could be an issue with libGL or libstdc++. See here

Dan Bray
  • 7,242
  • 3
  • 52
  • 70
  • 1
    1) the field is not editable for me, set to automatic 2) I don't have any of those 3) it is a fresh install of AS 4.0 with all tools updated – Tim Nov 21 '19 at 20:45
  • 1
    I tried all the obvious things already. Profiling for app leaks is irrelevant because I'm not even able to run apps – Tim Nov 22 '19 at 08:46
0

It sounds like the emulator may have not installed correctly. Check these steps:

  1. Ensure that you have installed Hyper-V . Documentation for running emulator on AMD

  2. Then try this step to force a cold boot: Android Studio Emulator and "Process finished with exit code -1073741511 (0xC0000139)"

If Its crashes again, then create a new emulator. You might also try and download a new image just to make sure that the one you installed is not corrupt.

  • 1
    yes those steps are rather obvious. The error codes are different here btw – Tim Nov 25 '19 at 12:52
  • I noticed that too. But considering that your emulator is crashing, and as you did not list steps you have already tried to resolved the issue, one could assume that you have not tried these. You might want to update your question to list the "obvious stuff" you have already tried in order to avoid "obvious" answers! – Opatile Kelobang Nov 25 '19 at 12:56
0

You said you're using Windows 10? Error code 0xC0000409 is caused by a stack buffer overflow. It seems to have popped up a couple places all related by windows systems (might be totally irrespective of the android emulator). If this is the case I found a couple threads that might help solve your problem.

http://www.cplusplus.com/forum/windows/39061/

https://answers.microsoft.com/en-us/windows/forum/all/werfaultexe-the-exception-unknown-software/627da5c0-004a-e011-8dfc-68b599b31bf5?auth=1

http://windowsbulletin.com/solved-exception-code-0xc0000409-error/

https://www.tenforums.com/tutorials/16397-repair-install-windows-10-place-upgrade.html