< Home

At the moment I am dabbling a bit in Flutter and while having slow progress (thanks to my children) I still enjoy it a lot. Now, my old computer was getting a bit slow so I bought a new one and while thorougly tested the performance in games there was one huge hiccup. I could not get the android emulator working anymore.

The error Android Studio logs provided was

2023-03-07 08:54:06,366 [   5818]   INFO - Emulator: Pixel XL API 33 - Process finished with exit code -1073741515 (0xC0000135)
2023-03-07 08:54:06,369 [   5821] SEVERE - Emulator: Pixel XL API 33 - Emulator terminated with exit code -1073741515
java.lang.Throwable: Emulator terminated with exit code -1073741515
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
    at com.android.tools.idea.avdmanager.EmulatorProcessHandler$ConsoleListener.onTextAvailable(EmulatorProcessHandler.kt:89)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.intellij.execution.process.ProcessHandler$2.invoke(ProcessHandler.java:248)
    at com.sun.proxy.$Proxy27.onTextAvailable(Unknown Source)
    at com.intellij.execution.process.ProcessHandler.notifyTextAvailable(ProcessHandler.java:222)
    at com.intellij.execution.process.ProcessTerminatedListener.processTerminated(ProcessTerminatedListener.java:54)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.intellij.execution.process.ProcessHandler$2.invoke(ProcessHandler.java:248)
    at com.sun.proxy.$Proxy27.processTerminated(Unknown Source)
    at com.intellij.execution.process.ProcessHandler.lambda$notifyTerminated$2(ProcessHandler.java:206)
    at com.intellij.execution.process.ProcessHandler$TasksRunner.execute(ProcessHandler.java:281)
    at com.intellij.execution.process.ProcessHandler.notifyTerminated(ProcessHandler.java:189)
    at com.intellij.execution.process.ProcessHandler.notifyProcessTerminated(ProcessHandler.java:185)
    at com.intellij.execution.process.BaseProcessHandler.onOSProcessTerminated(BaseProcessHandler.java:61)
    at com.intellij.execution.process.BaseOSProcessHandler$1.lambda$startNotified$0(BaseOSProcessHandler.java:98)
    at com.intellij.execution.process.ProcessWaitFor.lambda$new$0(ProcessWaitFor.java:45)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:212)
    at com.intellij.execution.process.ProcessWaitFor.lambda$new$1(ProcessWaitFor.java:23)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:829)

Ok, so a very long and cryptic exit code is always a bad sign. Searching Google gave me the impression this was a Windows exit code to tell you “you are missing some DLLs”.

I tried a lot of general solutions, installing VCRedists from 2008, 2013, 2015, 2017,… Installing MSYS2. Reinstalling the whole Android suite, enabling/disabling Hyper-V, HAXM, using different Android versions, checking the BIOS (everything was ok from the start),… I even ran DependencyChecker on the emulator file and everything was OK.

And then I started going deeper. What did the emulator use for emulation? Qemu. I tried running the individual Qemu files which are packaged with the emulator but that struck the same error code -1073741515 or 0xC0000135. Which kept telling me that some DLLs were missing. Just nobody was able to tell me which ones. So I kept digging and using more and more broad keywords until I came upon this Stackoverflow post. The exit code wasn’t the same, nothing of those errors were found in my logs but at this point I was 6 hours far and I noticed that the guy answering said MPFlat.dll is a core part of the android studio emulator.

While I normally would not just take these sort of comments at face-value I was kinda desperate and started to investigate if I had MPFlat.dll on my computer.

Everything told me “no”.

So I started to search for which Windows feature provided MPFlat.dll and to my surprise it said “Windows Media Feature Pack”. Good thing I only installed this PC like a week ago because I remembered I installed the Windows 10 PRO N version which does not include any media package!

A quick search provided me a way to install these missing optional features and after a restart everything worked fine.

Windows 10 N:  Select the Start button, then select Settings > Apps > Apps & features > Optional features > Add a feature.  Then locate the Media Feature Pack in the list of available optional features.

Windows 11 N:  Select the Start button, then select Settings > Apps > Optional features.  Select View features next to Add an optional feature, and then select the Media Feature Pack in the list of available optional features.

So… Android Studio Emulator depends on your Windows having the Media Feature Package installed. The reason I also missed this MPFlat.dll is purely because I checked emulator.exe and not the other software that the emulator uses. The error message could be a bit better but in the end I only wasted a day (arghhhh)

< Home