Android Studio emulator not running for hours - android

Android studio emulator doesn't run even if the run button was pressed for hours
Waiting for device.
"C:\Program Files\Android\android-studio\sdk\tools\emulator.exe" -avd MyAvd0 -netspeed full -netdelay none
appeared for hours.
It has not running since my second startup for the Android Studio. It faced the fatal error saying that the cache is blocked. After changing the permission of the user for adding full control access, it starts.I did add an sd card of 1024MB for the emulator before.The emulator still not starting up. I have even tried to uninstall and reinstall it
found this now in adb
DeviceMonitor: Adb connection Error:An existing connection was forcibly closed by the remote host
Starting emulator for AVD 'MyAvd0'
emulator: ERROR: Unable to load VM from snapshot. The snapshot has been saved for a different hardware configuration.

I'd highly encourage you to try Genymotion. You'll probably set it up faster than solving your avd issues, and in general terms, it works pretty much better.

It sounds like the Snapshot option is enabled for your VM, but you have changed it's config after the snapshot was saved. To fix this try the following:
Open the Android Virtual Device Manager
Select your AVD, then click the Edit button
In the dialog that shows, uncheck the Snapshot option (it is under Emulation Options).
Now try to start the emulator again.
Alternately, just open the Android Virtual Device Manager, delete the AVD, and create a new AVD.
Note:
As ssantos mentions, Genymotion is a fantastic emulator and I personally use it for my day-to-day testing. It is definitely worth checking out if you have the time :)

Check while creating the avd in Android Virtual Device Manager if there were any warnings, for me there was it said (paraphrasing) "for windows RAM size greater the 768 MB might cause problems in emulator". After making the RAM size 768 MB it worked and started immediately

I was also facing similar issue but there were no errors in my case, only the emulator keeped on starting but not displaying the home screen.
So I just Opened the AVD Manager then
Under Actions Tab
Click the Third Icon (pointing downwards), It will open the some options
Select Wipe Data
And you are Done :)

Related

I am not able to start my AVD or Emulator in android Studio

While running Emulator its shows Emulator was Killed.
In Activity Log I can see an error named as:
"Emulator: Process finished with exit code -1073741515 (0xC0000135)"
I have tried---->
To clean/wipe and cold reset
Even I have tried by creating a new Emulator with RAM size 4 Gb also. But still, I faced the same problem which I had encountered earlier.
My IDE and SDK are updated.
I had also tried to configure my AVD's Graphics from Automatic to Software-GLS 2.0 but that doesn't work too.
But the same project can be run on my Android Phone.
My PC's Virtualisation is "Enabled"
Please Help me with that...
There's some suggestions in here about running the emulator from the command line, so you get some more useful info.
Since you mentioned RAM size, make sure you have enough local storage on the virtual device too - I've had a lot of problems where I've tried to keep it low (it'll be fine! I'm only installing one small app!) and the emulator misbehaves and won't run properly

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 Shutting down in few seconds after launching

Well I created a new AVD from AVD manager that is "Nexus 5x API 25". When I Launch the AVD in emulators it gets launched and stay for while (30 Seconds) and Shutdown Automatically.
I tried editing the Ram Size in Config.ini of AVD, but still the same problem.
My computer Configurations are:
Intel Core i3
Ram Size: 4 GB
HDD: 500 GB
Solution.1
By setting the Graphics option on the Android Virtual Device to Software instead of Automatic or Hardware. Once you did that the emulator device started up great and everything worked.
Or
Go to Menu->Tools->Android and uncheck the option Enable ADB Integration Run the application. Now the emulator will be launched, but app will not run. Once the emulator is fully launched, check the Enable ADB Integration option and re-run the app. Now the app will be launched in the already running emulator.
My Android emulator was shutting down almost as soon as Android Studio started it.
I went to the Android Virtual Device Manager and under "Actions" for the misbehaving virtual device, I selected "Cold Boot Now". This seemed to resolve my problem.
I am using Android Studio 3.1.4.
I'm in the same boat with a late 2019 version of Android Studio (v3.5.2), and I've been using it a couple of years, so it seems like a new problem to me. I am able to resolve it by either 'wipe data' (undesirable, often) or 'cold boot' (from tools->avd manager) and then running the app. However, this is not a permanent solution, because it always comes back. I usually wind up doing the cold boot thing once, then be careful not to close the emulator while I am debugging so it is good until next session.
I will note i noticed Android Studio was HIGH on memory usage (which is more difficult to notice in SSD times, because you don't "hear" the hard drive thrashing from swapping memory.) Android studio itself noticed the abnormally high memory usage and reported this to Google (presumably). I wonder if low physical memory is/was the issue.
Update: I just had a BIOS update for my notebook, and afterwards, I do not seem to have the same problem. It is not clear if there was a BIOS problem (virtualization, which emulator uses, is a BIOS option) or if it was just the reboot which temporarily cleared up memory (my original guess).

Error while waiting for device: Timed out after 300seconds waiting for emulator to come online

I have been trying to use android studio emulator but I can not run my App on the Emulator. When I Run my App it shows the emulator with following details:
Hax is enabled
Hax ram_size 0x40000000
HAX is working and emulator runs in fast virt mode.
Console on port 5554; ADB on port 5555
After that it takes to next TAB Launching app and shows waiting for the device to come online. After that it shows error:
Error while waiting for device: Time out after 300 seconds waiting for emulator to come online.
Anyone know any solution.
Although there could be various reasons for this behaviour....
Mostly it may be due to error in system images or the API version you are using
better you download latest system images and make sure the compatibilty of API version you are using.
If problem exists
I would like to suggest some fixes:
Try them
1)Uninstall/Reinstall Android SDK to folder.
OR
2) delete the emulator and create another emulator targeted at the appropriate API Level.
OR
3)create a new Virtual Device.
OR
4)set "Max VM application heap size" hardware property to 192 or higher and pick the QVGA skin.
hope it helps.
I was also facing this timeout error. Here is the solution worked for me
Launch Task Manager -> Search for adb.exe in process list->End the process->Try relaunching the emulator it will start.
This helped me:
https://www.youtube.com/watch?v=avcOIrtimMU
Click on app: edit configurations;
In Launch Options: choose Specific Activity
In Activity: specify your main class: com.example.budgetapp.MainActivity
And, run.
This Worked for me:
GoTo SDK Manager -> SDK Tools -> Check that the android emulator has the latest version and If doesn't install the updates.
I had the same error described here.
Hope This Helps
Check updates.... Emulator had an update.
After I updated worked fine.
I went through a lot of posts. But none of them seemed to work for me. Every time I tried to start the emulator, the process seemed to be "not responding" after a minute or so. I tried restarting my PC, adb, created new devices, even re-installed Android Emulator, but nothing worked.
Surprisingly enough, what worked though was to move the emulator out of Android Studio.
Go to Preferences -> search for Emulator -> Uncheck Launch in a tool window
I am using Mac M1 Pro with Android Studio Bumblebee | 2021.1.1
Open the AVD Manager.
Create a new AVD or edit an existing AVD.
In the Verify Configuration page, specify the Emulated Performance: Graphics change to sofware or hadware
good luck
I tried everything here and other questions too, but the only solution for me was to create a new AVD.
Also downgraded from Pixel3XL to Pixel2, not sure if it matters. (Kept same android version)

Android AVD not showing anything. only "ANDROID" in the middle of the screen

I am an Android Newbie! please help.
I have been following googles introduction tutorial and managed to install everything with no problems. but whenever i try to run the HelloAndroid example the avd launches but doesnt show anything.
cone somebody help please?
After you create an AVD it really does take a long time to initialize. On my less than year old Core2Duo 2.8 GHz running Win7x64 and 4Gb of RAM, initializing a 2.2 version took at least 5 to 10 minutes (if not longer). Once it starts initializing you can watch the logcat in the DDMS panel of eclipse and watch it unpack and install all of the apps in the emulator.
It is quicker to export the file to your phone using USB cable, install it by selecting the .apk file with a file manager and run it from your phone. This also gives you "real" simulations of the app. It is quicker also. If your app has flaws, it is quicker to find them on your phone then wait for the AVD to load only to find your app doesn't work!
Goto File -> Export, select android folder then android application.
On the next page, select the application you want to export.
Create a keyfile and an alias.
Eject your phone, then open your file manager of choice, and click on the app.
Run using android package installer, you will need to enable no market application install in your settings
Open the app after the install is complete.
You can always run 'adb shell' or 'adb logcat' from another window to see what is happening...
I had the same problem but I fixed it by deleting .android folder from C:\Users\User\
Now everytime I start Eclipse or AVD, I delete that folder. After that everything works charm.
OPTIONAL : If the problem still persists, try to clone the NEXUS S AVD.
How long did you wait for it? On my (admittedly older and slower) home computer, it can take some time for the AVD to initialize the first time. I've just tried it and it takes about 90 seconds for the "ANDROID" in the center of the screen to be replaced with the home screen, then about another 30 seconds for the application to run.
I had the same problem. It was because i hadn't restarted my system after installing ADT plugin. It worked fine after restarting my system.
Occasionally i've found that it just hangs up on the loading screen, and if you restart it, it comes right. Also, from memory it can take awful long to load first time.
For Ubuntu (I use Xubuntu):
Mine Android Virtual Devices didn't started because i used NVIDIA drivers for ubuntu. After changing drivers to Nouveau it booted in 15sec.
Go to "Settings Manager" -> Software & Updated -> Additional Drivers chose: "Using X.org x server -- Nouveau display driver (open source)"
NVIDIA F# U http://www.youtube.com/watch?v=55XVnJ_0qhg
Yeah It took too much time to start....
Try Switching on Visualization in the system BIOS Settings....
For me before switching it didn't show up anything. After changing it took 3 mins to initiate
System Specs:
i5 Dual Core
4Gb
Nvidia 2G
Stop the emulator --> Open ADV Manager --> Edit the Virtual device --> Click Show Advanced Settings --> Set the Ram size 512mb --> Start the emulator

Categories

Resources