Can not run my app on emulator - error while loading state for instance 0x0 of device 'goldfish_pipe' - android-emulator

Yesterday I've created Pixel 3 XL device to test my app on emulator. It was working yesterday but today I'm getting these errors when I try to run my app.
14:58 Emulator: C:\Users\Mert\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: error while loading state for instance 0x0 of device 'goldfish_pipe'
14:58 Emulator: deleteSnapshot: for default_boot
14:58 Emulator: Process finished with exit code 0

for me, I have installed a newer version of HAXM and it worked perfectly

Deleting device from AVD Manager and creating a new one(I created the same one) worked for me

Download the google play version marked in yellow rather google API.
Creating emulator again with image from google play will also make sure reinstallation of HAXM.

I solve this issue within Android Studio SDK Manager, update to a newer version of Android SDK Build-Tools and Intel x86 Emulator Accelerator (HAXM installer), in the HAXM installer wizzard I put 4GB RAM size.
image

In my case I deleted the old devices and downloaded the Google Play play version image and manually changed adb.exe file.

Actually the working HAXM version isn't always the newests, as other answers suggest. I had HAXM version 7.8.0 (latest version ATM) installed on my Windows, but even though I was getting the question error (error while loading state for instance 0x0 of device 'goldfish_pipe'). I had it installed via its own installer, outside Android Studio, because I was getting error trying to install HAXM via Android Studio.
Then I had the idea to uninstall that latest version (7.8.0 ATM) and again try to install the version shown in Android Studio (7.6.5 ATM) via Android Studio itself, and it worked! So I realized the steps I needed to take in order to successfully install HAXM via installer (step 1 shown here) also fixed the problem trying to install it via Android Studio! And finally, after hours and hours of harrassment, I could successfully launch a virtual device on the emulator.
Below is the step for successfully installing HAXM (taken from here):
At last but not least, make sure you have no other virtual machine running! It would throw you at this thread's error.

My case is:
disable Intel x86 Emulator Accelerator (HAXM installer) in Android Studio SDK Manager
uninstall HAXM as a result
enable again Intel x86 Emulator Accelerator (HAXM installer) in Android Studio SDK Manager
install HAXM as a result
recreate emulated AVD
finally works for Me

Related

Anti-aliasing does not seem to work in Android Emulator

I was working fine with Android Emulator (on Manjaro Linux) a few weeks ago, but after updating software The GUI of Android Emulator is not rendering or anti-aliasing is not working anymore. My apps are displaying horrible texts.
I'm using Hardware-GLES 2.0 for my graphic emulator.
Additional info:
Is there another alternative Android emulator working with Visual Studio Code?
ANSWER: Android Studio's Android emulator is not an efficient emulator, a better emulator is Genymotion.
I had a same problem. Downgrading Android Emulator to lower version solved the issue.
Latest version (before 30.9.5) that I could find was 30.8.4 with build id 7600983.
In order to downgrade firstly you will need to download the emulator. Here are the links for the version 30.8.4:
Linux - https://dl.google.com/android/repository/emulator-linux_x64-7600983.zip
MacOS - https://dl.google.com/android/repository/emulator-darwin_x64-7600983.zip
Windows - https://dl.google.com/android/repository/emulator-windows_x64-7600983.zip
You can also download even older versions here are few alternatives
After downloading the needed version of emulator you will need to unzip it.
The next thing is to replace your current emulator with new one.
Go to your Android Sdk folder (mine was ~/Android/Sdk)
cd ~/Android/Sdk
Rename your
current emulator files folder. mv emulator emulator.bak
Copy new
emulator
cp -r ~/Downloads/emulator-linux_x64-7600983/emulator/ .
Replace package.xml file (otherwise Android Studio will not
recognize your new emulator)
cp emulator.bak/package.xml emulator/package.xml
Restart your Android Studio and Enjoy!
Seems like this issue was fixed with newest major 32 version of Android emulator.
Newest 32.1.6 and 32.1.7 Canary 1 versions behave like the things were before 30.9.5 which broke anti-aliasing completely for me on all Windows devices. I am using Hyper-V so HAXM is not available for me.
Emulators archive: https://developer.android.com/studio/emulator_archive

Visual Studio Code - Flutter : "Device emulator-5554 is offline"

I have just spent an hour reading through similar questions on Stack Overflow, and they are all for Android Studio, not Visual Studio Code. Also, I am doing Flutter development, so don't have access to adb commands, such as adb kill-server.
Everything was fine, unlike I clicked the power button on my emulated Android. Now, when I run/start debug and select active device, I get Failed to launch Nexus 5X API 29 x86: Error: Emulator didn't connect within 60 seconds.
How can I restart the emulated device? When it appears, clicking the power button does not seem to do anything. Is there a flutter terminal command?
Or can I somehow use a different emulator (if so, how)?
I faced the same issue with Android Virtual Device and Memu emulator so I switched to Genymotion.
I am using Genymotion personal edition which works amazingly and it's very light on resources too as compared to AVD and Memu.
You can download Genymotion Personal edition from Genymotion Personal Edition
Apart from Installing emulator Image you should also consider installing the GAPPS bundle in the emulator as it does not comes with it preinstalled. GAPPS will be needed in many apps requiring Google Play Services.
Here are the docs on how to install GAPPS in Genymotion emulator: GAAPS Docs
GAAPS Website
My Genymotion Emulator is Google Pixel 3a, 9.0 API 28.

Running Flutter on a Genymotion machine using VS Code

I'm using VS Code as my IDE for Flutter and I'm trying to run my app in a Genymotion machine. How can I do that? The machine doesn't appear in VS Code bottom bar in the Devices section.
N.B:
I'm not looking for any solutions regarding Android emulators or Android Studio, only VS Code with Genymotion.
Alright, so after an hour or so of searching I found out the solution. It's entirely the same as the approach of using Genymotion in Android Studio. The only difference is you don't need to install a plugin for VS Code. However, in my case, it was a bug in Genymotion it self. I was using v3.0.1 which had some incompatibility bug with Android SDK 28 and this was the reason why the Genymotion machine did not show up as a device in VS Code, because this latter relies on Android SDK to determine what are the devices that run Android.
The solution for me was simply upgrading my Genymotion to v3.0.2 which fixed the incompatibility with Android SDK 28.
In case anyone runs into this problem in the future and this doesn't work, make sure that your Genymotion ADB settings use the Android SDK installed in your machine by Android Studio and not the one shipped with Genymotion itself.

Android Studio Emulator Error: "deleteSnapshot: for default_boot"

I installed Android Emulator and Google Play Intel x86 Atom System Image (API 28) and configured a AVD, then ran it for first time. The emulator window showed and closed immediately and in Event Log, I see this error:
5:48 PM Emulator: deleteSnapshot: for default_boot
5:48 PM Emulator: Process finished with exit code 0
This error occurs in both Cold and Quick Boot.
I already installed the Intel x86 Emulator Accelerator (HAXM).
I currently use Android Studio 3.1.4.
I tried using Wipe Data and recreating the AVD, but nothing became affected.
What's wrong and how to fix this problem?
Actualy I got similar error often:
`16:22 Emulator: D:\Data\Sdk\Android\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe: error while loading state for instance 0x0 of device 'goldfish_pipe'
16:22 Emulator: deleteSnapshot: for default_boot
16:22 Emulator: qemu: unsupported keyboard cmd=0x84
16:22 Emulator: Process finished with exit code 0`
I figured out it is good to make snapshot when you install new device(like google account etc.)
When the error occurrs again, then you need to edit device, Show advanced settings and select Boot from snapshot.
Dude I was having the same problem and solved doing the following:
I accessed Android Studio, went to the list of my AVDs and wiped the data with the "Wipe Data" function.
After that it went back to normal operation.
Hope this helps! = D
I think the problem was with my CPU. So I used Genymotion (that uses VirtualBox), it's much faster than AVD. I repeat it's very FAST. Now, I'm using Android 9 (Pie) on Genymotion.
I recommend Genymotion for those who have problems with AVD.
If there is unused AVD's remove them,then Try to increase RAM size of the emulator and restart your android studio.
In my case Avast was the cause of the problem, I'm solve it deactivating avast's shields for 10 minutes, run the emulator (It runs well again but deleted all the previous apps installed), closed it, close android studio, reactivate the Avast's shield again and run android studio and the emulator works fine again now.

Can I use any other emulator other than HAXM emulator to create an android app?

I wanted to create an android app. Therefore I installed Eclipse IDE and installed other required SDK packages. But when I tried installing HAXM emulator my system did not support the virtualisation technology. Is there any other emulator that I can use or is there any way that I can create an android app online and run it online.
Try the Visual Studio Emulator for Android if you're on a PC. It's a fast, x86, Hyper-V emulator and comes free with Visual Studio 2015 (you can try out CTP5 here)