Android Emulator won't starting up - android

I just installed Intel HAXM and updated my Android SDK Tools to revision 24.1.2 successfully. Then I restarted my PC, and ran the emulator. Unfortunately, I my emulator won't starting up, always stuck. Waiting for ~1 hour, the emulator still getting stuck. Sometimes the screen was black, didn't show anything even the ANDROID logo while emulator was booting (full of black color). My screenshot:
The second problem is, as you can see in the figure, this is an abnormal behavior. There's no title bar, because it hides on the top of my desktop. So I can't move the emulator window to the center of my desktop.
From the Console, it seems that Android Studio is waiting for the emulator to finish its start up:
What have I tried:
Restarted my PC.
Followed this answer.
Check and uncheck Use host GPU option in AVD.
Re-build my emulator in AVD.
Closed the emulator and ran it again.
Changed CPU/ABI to ARM and Intel Atom x86 in AVD.
Can you help me to solve these problems?

Have you tried with a different\more recent Android version?
I suggest you to switch to Genymotion.
It's free for personal use and it very better than AVD: it's faster, you can drag and drop files and much more.

I asked my mom to pray for me to solve these problems, and I found the solution then, hehe :P
So these problems happened because of the skin of emulator I selected in AVD was WQVGA432. Then I changed (edited) the emulator's skin in AVD to WQVGA400 and WQVGA800 to test the result, and it really works for both of them. I think, the only skin which has broken is WQVGA432. If you also had these problems, I suggest you to never select WQVGA432 skin or try another skins.
Now, I can move the emulator window normally and debug my app.

Try updating Android Studio and re-download the image file from SDK

Related

Android Studio Emulator and "Process finished with exit code 0"

I've updated android studio from 3.0 to 3.0.1 but when I launch Emulator it didn't get launched and gives message in event log:
Emulator: Process finished with exit code 0
You need to check:
Your size on disk is not full - this's often happen due to creation of some virtual devices that are unused
The RAM size of emulator is not minimum as your requirements
One more thing that I personally use: Use Pen Drive as a RAM
Updated:
Use HDD as RAM
Right Click on “This PC or My Computer” and Select Properties.
Now Click on “Advance System Settings”.
Now in “System Properties” you have to select “Advanced” tab.
Now click on “Settings” Under “Performance”.
Now in “Performance Option” again you have to select “Advanced” tab.
Now click on “change“ under “Virtual Memory”.
Un-check “Automatically manage paging file size of all drivers” and select “Custom size”.
In Custom Size enter the amount of data According to “Space available” which is written there.
Click on “set” button and Click on OK.
Now it will ask you to restart your Computer or Laptop.
Another work around steps (tested) :
Restart your Android Studio
Create new device in your AVD Manager
Increase the RAM size of the Emulator
I restarted Android Studio and create a new device in AVD MANAGER then I have increased the RAM size of emulator and it works nicely.
UPDATED
Sometimes it happens when you close emulator during building the App in to emulator.
I also faced the same error. After a few hours I figured it out.
I hope it helps you :
Go to Tools ==> SDK Menager ==>Android SDK
(Appearange&Behavior=>System settings=>Android SDK)==>SDK Tools==>Intel x86 Emulator Accelerator(install this).
It will solve your problem.I hope it helps.
I had this problem and it took me nearly 2 days to resolve...
I had moved my SDK location, due to the system drive being full, and it seems that someone, somewhere at Android Studio central has hard-coded the path to the HaxM driver installer. As my HamX driver was out of date, the emulator wouldn't start.
Solution: navigate to [your sdk location]\extras\intel\Hardware_Accelerated_Execution_Manager and run the intelhaxm-android.exe installer to update yourself to the latest driver.
I had this issue in Android Studio 3.1 :
I only have on board graphics. Went to Tools -> AVD Manager -> (Edit this AVD) under Actions -> Emulated Performance (Graphics): select "Software GLES 2.0".
In AVD Manager,
Go to Edit Icon on AVD Manager for selected Device.
Click on show advanced settings and increase ram size from 1500 mb to 2 GB.
Then it works.
NOTE: Some virtual devices do not allow you to update RAM, but if so, try installing Nexus 4. because it does.
NOTE2: If still doesnt work, dont give up. just uninstall and reinstall the device with changing RAM again. in some cases this is how it works
NOTE3: If still doesnt work, this means your pc doesnt have enough ram space. so increase the ram to 3gb. it might work but it will suffer
NOTE4: If still doesnt work, try it with multicore 2 instead of 4.
NOTE5: Still doesnt work. Close the Android Studio and NEVER open it back :)
Docker installation selected Hyper-V on windows by default. Deselect the Hyper-v b
This worked for me.
I was able to get past this by making sure all my SDKs were up to date. (Mac OS 10.13.3, Android Studio 3.0.1). I went to Android Studio -> Check for Updates... and let it run. Once my Android 5.0/5.1 (API level 21/22) SDKs were updated to revision 2:
After doing this update, I was able to run the emulator without crashing out immediately with a "Emulator: Process finished with exit code 0" error.
None of the solutions worked for me. I upgraded my previous Android Studio to 3.0.1 and received this issue while trying to restart the emulator.
What worked for me was deleting Android Studio from Windows 'Add or Remove Programs'. Then go to C:\Users[User] and delete any android-related folders (.android, .AndroidStudioX.X, Android).
Next go to C:\Users[User]\AppData\Local and delete any Android-related folders there. Restart your system and re-download android studio from their official site (https://developer.android.com/studio/index.html). Install Android Studio from fresh and don't import any old settings.
When Android Studio finishes installing, I launched AVD from 'Tools > Android > AVD Manager', created a pixel 2 device with 4096mb of RAM running Android API P x86. Start it up and it works!
This can be solved by the following step:
Please ensure "Windows Hypervisor Platform" is installed. If it's not installed, install it, restart your computer and you will be good to go.
Android Studio Emulator: Process finished with exit code 1. Maybe disk drive is FULL. You can delete some virtual devices unused. It works for me.
it's next to the edit in your virtual manager devices menu (the arrow down)
I also had the same problem.I fix this problem by editing Graphics of AVD.
Tools > Androids > AVD Manager > Actions > Edit > Show Advance Settings > Graphics -> Software.
I hope this solution help u!
You can try to delete the emulator and reinstall it this usually does the trick for me. Sometimes you also run into hiccups on your computer so try restarting your computer. Your computer may not be able to handle android studio if so there is nothing you can do. Consequently, you may not have the right ram requirements. Finally, If all else fails you can try to delete then reinstall android studio.
I solved this issue by offing all of advantage features of my graphics card in its settings(Nvidaa type). It started to throw such hanging error less a lot. But finally I found a simplier way: In avd manager you need to put less resolution for the avd. Say, 400x800. Then I reenabled graphics card features again and now it runs all ok. (I suspect my graphics card or cpu are weaker than needed. )
In my case, Emulator: Process finished with exit code 0 error started after I pressed on Restart in the Emulator.
It happened because in Android Studio 3.0 and up versions, the emulator saves the states of the current screen to launch it very quickly at next time. So when I pressed on Restart it closes emulator by saving state as Restart. So when I launch/start the emulator, it executes the Save States as Restart and then after emulator is not started automatically. So basically it stuck in to Save States of Restart.
I don't want to delete existing emulator and create a new one.
My default Boot Option of Emulator was Quick boot in AVD.
By doing Cold Boot Now from AVD (Android Virtual Device) Manager, it starts emulator again in normal mode without Save State.
Cold boot start emulator as from power up.
I was getting the following error when starting the emulator and none of the answers fixed it.
Emulator: Process finished with exit code -1073741515 (0xC0000135)
Finally I found that Visual C++ is not installed in my system. If it is not installed please install Visual C++ and check.
Please find the link below to download latest Visual C++.
https://support.microsoft.com/en-in/help/2977003/the-latest-supported-visual-c-downloads

Android Emulator Stuck With Black Screen

I'm just new with Android Development, and running the default blank project. I have Android Studio 2.1.2.
The problem is the emulator stuck with the black screen although HAXM works well:
"HAX is working and emulator runs in fast virt mode"
Most solutions suggest to uncheck "use host gpu" in AVD Manager, yet it seems this feature no longer appear in the new version of Android Studio.
I run macOS El Capitan.
After an update to Android Studio this weekend (maybe Gradle?), the AVD emulator (Mac) suddenly started showing a black screen when I ran my installed app APK. Sometimes it showed a blue screen. Sometimes the emulator even showed a page of installed app icons. Sometimes upside down. Sometimes upside down and reversed! That smelled like a graphics problem.
Thanks to audio in my app, I realized I could still activate buttons in my app by clicking on a specific location of the black screen. Definitely a graphics problem.
Based on other ideas that I read, I edited my AVD device config in the Emulated Performance section, to change Graphics from "Automatic" to "Software - GLES 2.0".
It worked for me on the emulators for Nexus 9 and Pixel XL on API 25.
This solution does not work on Play Store-enabled devices because the Graphics setting can't be changed. For example the Nexus 5X API 25.
Environment: Android Studio 3.0.1, Gradle 4.1
Increase the RAM size to 2.5GB in Advance settings of Emulator. Black Screen will be gone.
It worked for me
The reason why I got stuck with black screen in the emulator is that I needed to update my Android SDK Tools. Hope this could help someone get the same issue.
I believe the emulator was updated in studio 2.1.3, can you update and see if you have the exact problem?
download is here, 2nd set of links:
http://tools.android.com/
Selecting CPU/ABI with Intel Atom(x86_64) (when creat a emulator or editing a emulator) worked for me.

Android Emulator freezes

Until the last SDK release, my Android Emulator worked very nice with x86 architecture, installing Intel HAXM and enabling GPU for the device in AVD Manager.
With the latest SDK release, I reinstalled my Windows (from 8.0 to 8.1), tried both 1.06 and 1.07 Intel HAXM and my app freezes quite frequently.
It doesn't freeze to death, just the freezes/does not updates the screen anymore.
Especially if I'm swiping a ViewPager, then it freezes almost always in between pages.
BUT, if I click a menuitem on the AppBar, it refreshes itself and draws the destination ViewPage page.
I'd appreciate any advice, because right now app development via emulator became ultrapainful.
My emulator froze and I couldn't fix it with the other answers, but this solved it:
Tools->AVD Manager
In the Actions column for your virtual device, click the white arrow on the right and then click Wipe Data.
This will clear the cache for the virtual device.
If your app depends on Google Play services, you will need to update it again
Try this:
In the Android Virtual Device (AVD) settings, select
- edit this AVD, then click
- show advanced setting then
- DISABLE multi-core CPU.
In the Android Virtual Device (AVD) settings, turn off the Use Host GPU emulation option. Unfortunately, the resulting slowness is often worse than the freezing.
Before doing the steps you need to delete the .lock folder under the C:\Users\user\.android\avd\yourEmulatorName\ path, To go there just simply click Show on Desk .Then -
Step 1: Go to AVD Manager and click the drop-down and select Stop. The emulator will be stopped then.
Step 2: Then click the Cold Boot Now
Use the free Visual Studio Emulator for Android. It's very fast, and despite its name, does not require you to work in Visual Studio to use it. Android Studio and Eclipse happily detect it as the running emulator.
Setting Boot option to Cold boot worked like a charm for me. Absolutely no idea why.
Also disabling advanced profiling helped me with older versions (API 21).
What helped me was to use a lower version of SDK in emulator, namely the SDK version 31 (image "S")
Please note the date I'm writing this, if you are seeing this in the future try lowering your version acccordingly
stop the emulator and go to C:\Users\YOUR_USER\.android\avd\Pixel_6_Pro_Edited_API_33.avd and delete
version_num.cache
cache.img.qcow2
cache.img
multiinstance.lock
hardware-qemu.ini.lock
AVD.conf
it will work
Try giving virtual device less RAM.
Android froze on start with 4GB (=4096MB) RAM but did not freeze with 3GB (=3072MB).
Note: I'm using Android Studio on Linux Mint 21.1.
From the Android SDK Manager, install Intel x86 Emulator Accelerator (HAXM installer) revision 5 or later, and then run sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.msi to update the drivers on your PC. This is version 1.1.0 of the accelerator, which seems to fix the freezing bug.
Try this :
sdk\tools\emulator.EXE -partition-size 512 -noaudio -no-boot-anim -avd Nexus5XAPI25 -prop monodroid.avdname=Nexus5XAPI25
After I added -noaudio option,it's ok

Android Studio Emulator not starting

Because the emulator was really slow I installed the intel x86 emulator. I changed the settings in my emulator (ARM to intel atom). Now when I run a project it takes me to the emulator selection screen and when I select it, the project starts running, but the emulator doesn't pop up.
I tried switching the cpu back to ARM, but it still doesn't work.
When I close Android studio it asks me if I want to disconnect from the project so I'm sure it is running.
I came across a few posts that said to give the device 768 ram, but that didn't work.
Anyone knows a solution?
I was facing the exact same issue, but for me reducing the device RAM to 768 did fix it. Therefore I'd suggest continuing to decrease the RAM values and trying to launch it.
How about to use Rock speed Emulator - Genymotion?
I know it sometimes take time to launch emulator and launch app in emulator too. But it depends on your configuration of your PC and settings you have done in Eclipse or Android Studio.
For example: You may have kept "Build Automatically" ON and it sometimes slow down running time.
My current rep is not high enough yet to comment on another answer, so I am adding a new "answer" to +1 Paresh Mayani's answer to use Genymotion. I only recently discovered it and found it to be much much faster than the emulator. Instead of emulation it runs an Android rom in a VM using VirtualBox. I've found that it runs full speed on my machine and is just as fast in debug mode as normal mode, which is impressive since even my Nexus 5 struggles when connected to a debugger.
In my case also x86 was creating problem, I installed Android 5.0.1 armeabi-v7a and have set 768MB as RAM size and it worked.
Try to check and run the emulator ie. store a snapshot for faster startup...
I have tried that by checking the button and works fine.
If you're using an AMD machine try using the "ARM EABI v7 system image". For an intel chip use the "APIs Intelx86 Atom system image". Also, try a different tablet from the Android Studio settings e.g(Nexus 6), as the API level might not be supported from in the Nexus5 VM. You will also have a little wait time for the android emulator, mine takes about 7mins

Android emulator not displaying anything

I am new to android just installed Android sdk with eclipse & ADT plugin, these stuff are working fine, but my emulator doesn't display anything after 30 minutes.
My target virtual device(AVD)
Android 4.0.3, API level-15
CPU/ABI: armeabi-v7a
I have tried tweak from stack overflow
"Hardware section:Device RAM Size=15", It helped because before trying it, emulator was crashing. Now emulator appears but nothing is displayed
Please help it is depressing start this way
There is an intermittent problem with the emulator that we've encountered in our testing. It seems to happen the first time an AVD is run.
If you don't see the main screen within a few minutes, you should force-kill the emulator, stop adb with 'adb kill-server' from a command line. Restart adb with 'adb start-server' and then restart the emulator with your AVD. Suggest also to turn off the snapshot until the first time it loads correctly. If you're using the GPU feature, turn it off as well.
I have found the solution, the problem was i haven't set environment variable, which was "C:\Program Files\Android\android-sdk\platform-tools\" in my case,
I was facing same problem. I solved it as below steps.
Go to AVD manager, select the corresponding AVD, then click on edit then select the device from the drop down menu. I forget to select the device, so there was nothing on my AVD. Only black screen was there.

Categories

Resources