The Android OS in the Emulator freezes and is unusable afterwards - android-studio

I can start the Emulator and it starts the Android OS good and in 60 fps. However, shortly after the start of the Emulator, Android just freezes (not the Emulator) and is unusable.
I find this error code in the Event Log: Emulator: error deleting WGL context! error 0x6 and this in the idea.log:
Process hasn't generated any output for a long time.
If it's a long-running mostly idle daemon process, consider overriding OSProcessHandler#readerOptions with 'BaseOutputReader.Options.forMostlySilentProcess()' to reduce CPU usage.
Command line: C:\Users\ARES\AppData\Local\Android\Sdk\emulator\emulator.exe -netdelay none -netspeed full -no-snapstorage -avd Pixel_2_API_29
java.lang.Throwable: Process creation:
[...]
This started happening after I installed Android Studio on Windows 10 after reverting the OS from Ubuntu. On Ubuntu, everything ran fine.
EDIT: I found out that only the first start after Windows boot works properly. Any other starts in the same Windows session produce this error.

Related

Android emulator (AVD) crashes on Wayland + NVIDIA (GBM)

Update: The problem does not occur with the NVIDIA driver version 510 anymore.
I am running Android Studio 2020.3.1 on Wayland and I'm using the proprietary NVIDIA driver version 495, which allows me to use the the regular GBM implementation of Wayland instead of the especially tailored EGL version.
My problem is, that every time I try to start an Android emulator (AVD) via the AVD Manager, I get the following message after a few seconds:
The emulator process for AVD Pixel_2_API_30 has terminated.
Starting the AVD from the command-line shows that a segmentation fault occurred:
INFO | Android emulator version 31.1.4.0 (build_id 7920983) (CL:N/A)
WARNING | unexpected system image feature string, emulator might not function correctly, please try updating the emulator.
INFO | Info: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. ((null):0, (null))
Fontconfig warning: "/usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf", line 6: unknown element "reset-dirs"
WARNING | cannot add library /home/letorbi/Android/Sdk/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
INFO | added library /home/letorbi/Android/Sdk/emulator/lib64/vulkan/libvulkan.so
Segmentation fault (core dumped)
How can I get more information and is there a workaround to prevent the segfault?
For what it's worth, Wayland EGL is able to start the emulator somehow, but I see nothing but a black screen on the device. X11 is working, but I'd like to stay on Wayland if it is possible.
I was able to work around the segmentation fault, by disabling the Vulkan support for AVDs. This can be easily achieved by adding the following line to the file ~/.android/advancedFeatures.ini:
Vulkan = off
I've got this hint from an answer in a related question. This answer also suggests to add GLDirectMem = on, but that line was not needed to solve my problem. However, some benchmarking revealed that it might improve the performance a little bit, so you might want to add that line as well.

Android Studio Error: VCPU Shutdown request

I,m running Intel Core i3, 4 GB Ram, 32bit, HAXM Version 7.2.0
Android emulator: Nexus 5X API 28
I give the following command in the terminal:
E:\Android_SDK\emulator>emulator #Nexus_5X_API_28
HAX is working and emulator runs in fast virt mode.
VCPU shutdown request (Shows the same about 15 times)
emulator: WARNING: Not saving state: emulator hasn't finished booting.
VCPU shutdown request
Tried all the methods but none of them helped.
For me, reinstalling intel haxm and it worked perfectly.
I had exact the same problem in Windows 10. The only solution I could find was that running emulator in terminal with administrator mode.
Good luck!

Android emulator does not boot on Ubuntu 15.04 (64bit)

When I start the emulator, the "phone" shows only a black screen. Nothing more happens. No loading, no pixels, no application nothing. Just a black screen.
Based on other forums i tried:
restart several times
install mesagl
install more c++ libs
start emulator without android studio
enable or disable "Use host gpu" option
limit emulator ram to 768mbyte
delete and recreate virtual device with several other api and abi
reinstall nvidia closed driver
Non of these helped.
Any other suggestions?

gdb remote debugging fails strangely

I am debugging a x86-64 device using Eclipse with gdb.
It was working fine till yesterday, when I cleaned my project and built it again. Now, I face a strange problem. It starts, and hits my first breakpoint. Then, I click Resume and it may run till my next breakpoint or give a remote failure reply e7295 error.
On the console I see these annoying lines:
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
My gdb commands are as follows:
set architecture i386:x64-32
set remotebaud 115200
target remote COM1
set disassembly-flavor intel
I restarted Eclipse and my laptop, I closed all unnecessary internal windows of Eclipse (memory browser, disassembly etc.), changed my serial cable, debugged the device with the same cable and project on my colleague's laptop.
What may be hindering gdb from debugging?

Building AOSP and launching the emulator

I am trying to launch the emulator after building the Android source.
Right now, the setup is like, I am running a windows machine connecting through putty to my linux machine. I have downloaded my source in the linux machine and I have successfully built it.
When I am running the emulator using the command in
https://stackoverflow.com/a/9023141/539472
the emulator is launching but only the android image is coming. From there on the emulator is not completely booting. Its not going to launcher.
The logs are
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
Failed to create Context 0x3005
There are many posts with this error, they say that check if the graphics driver is installed. I have checked it and its installed.
What might be the problem ?
Putty is just terminal console, it has no graphics/windows it cant possibly display emulator. Emulator is application like Browser or GEdit. If you login to you linux machine directly using Ubuntu then it can show emulator application.

Resources