Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator hangs forever at boot time

Emulator started, but not booting further "android" flashing text.

Started by

Android/Sdk/emulator/emulator @Nexus_5X_API_25 -verbose

In logs only repeating records

emulator: MemoryReport: Epoch: 140737476643856, Res/ResMax/Virt/VirtMax: 737525760 737525760 5164826624 5302894592

How to fix/debug it?..

Was working fine with KVM end virtualization, but suddenly stopped after updating to emulator to 26.1.2-4077558.

Update

Thanks to albodelu for information about update to 26.1.3. After Update I having:

KVM is required to run this AVD.
Unknown Error

Please file a bug against Android Studio.

KVM enabled. This was initial error which I fixed by adding executable permissions to emulator binaries. So done this again. Forced emulators to work by:

chmod a+x ~/Android/Sdk/emulator/emulator*
chmod a+x ~/Android/Sdk/emulator/lib64/lib*
chmod a+x ~/Android/Sdk/emulator/qemu/linux-x86_64/*
chmod a+x ~/Android/Sdk/emulator/qemu-img
chmod a+x ~/Android/Sdk/tools/emulator*
chmod a+x ~/Android/Sdk/tools/android
chmod a+x ~/Android/Sdk/tools/bin/*

And now miracle :) both emulator devices are working.

like image 538
Alexandr Avatar asked Jul 12 '17 14:07

Alexandr


People also ask

Why does emulator take so long to start?

Google emulator uses ARM opcode, a kind of machine language. It must convert from ARM opcode to Intel opcode. That's why it's slow.

Why is my emulator stuck?

Fix 1 – Stop Emulator from AVD Manager From Android Studio, select “Tools” > “Android” > AVD Manager. Right-click the emulator you are using, then choose “Stop“. Try running the emulator again.

Why Android Emulator is not opening?

If the Android Emulator does not start properly, this problem is often caused by problems with HAXM. HAXM issues are often the result of conflicts with other virtualization technologies, incorrect settings, or an out-of-date HAXM driver. Try reinstalling the HAXM driver, using the steps detailed in Installing HAXM.

Why are Android emulators so laggy?

Running multiple programs at once on your PC can cause performance issues. While running Android emulator for playing heavy games, you should always avoid using up the RAM of your computer. This will cause severe lag to your PC. You can close unwanted programs by going to "Task Manager".


3 Answers

emulator: MemoryReport: Epoch: 140737476643856, Res/ResMax/Virt/VirtMax: 737525760 737525760 5164826624 5302894592

Explanation:

Epoch: 140737476643856 /* this millisecond values gives when you created this emulator*/

Res/ResMax/Virt/VirtMax

Res - Resource memory used by a process (booting process). Since your booting process is using your total RAM (emulator's RAM), it is being kind of hang.

ResMax - Resource memory denotes the total actual RAM memory of your emulator.

Virt - Virtual Memory used by a process. It is swap memory.

VirtMax - The maximum Virtual Memory available in the emulator.

/*Note: Since the booting process has not used your total virtual memory, so your emulator is still running. But since all the RAM is full, the processing is happening, but it can't go further. So, it keeps showing "Android" in the screen.

I have these solutions based on order (the best is the top most).

1) Please increase your RAM memory of your emulator. Note: you should have more RAM on your laptop. You have to check your host machine's RAM use as well.

2) If your host machine (laptop) doesn't have more RAM, then you might want to find alternative emulator like GenyMotion, BlueStacks which takes less memory than Android Emulator.

GenyMotion: https://www.genymotion.com/

BlueStack: http://www.bluestacks.com/

Here is the picture how you can increase your RAM size in your emulator.

Open ADV > Edit > Show Advanced Settings > Below Screen appears > Increase RAM enter image description here

Note: VM Heap size has nothing to do with your problem. Each apps is a separate Dalvik Virtual Machine instance. VM heap gives how much RAM you can, at max, assign for each app.

Note: This problem is not related to your Graphics. It is the boot-time hang problem. So, Emulated performance based on Software or Hardware shouldn't be the answer.

like image 140
Uddhav P. Gautam Avatar answered Oct 22 '22 08:10

Uddhav P. Gautam


My answer is not exact solution to your problem but use Genymotion for simulation. It offers many devices from different brands and more robust AVDs. I only use AVD in Android Studio when i'm to test sensors virtually. That emulator is still cumbersome and very problematic.

like image 35
Thracian Avatar answered Oct 22 '22 08:10

Thracian


I've got this problem when I use hardware accelerated image. The solution that works for me, and may work for you is to create a new Virtual Device, and select "Software" under "Emulated Performance": enter image description here

like image 36
Amir Uval Avatar answered Oct 22 '22 07:10

Amir Uval