Android studio 1.x AVD not running? - android

I'm a newbie android developer ,since i upgraded to Andoid Studio 1.x from beta ,things became a lot easy , creating the AVD and managing SDK is managed better by the IDE now ,
I used the Default Nexus 5 config to setup an AVD,however can you please tell me how to safely turn it off ,I cant find any poweroff button , i have Intel HAXM set up and working fine, I got an error saying AVD instance aldready running etc asking me to delete the avd from user/android/avd/... which i did ,
WHen i created it i can run it just once, when i close and reopen studio and try to run again i get the following message
AVD Nexus_5_API_21 is already running.
If that is not the case, delete the files at
C:\Users\S****\.android\avd/Nexus_5_API_21.avd/*.lock
and try again
And what system image to use for the AVD, whats the difference between the ARM ,ATOM 86,ATOM 64 and googdle API images for the same android version, i use a windows 8.1 PC 64Bit running on a vt-x suported intel core i5 , 4200 u processor , which image should i use ,
Please Note i couldnt find solutons elsewhere and i doubt its an offtopic question as its about setting up a programming tool.
Btw the task manager shows a 32 bit emulator running
Thanks!

Here you Are :
when you click on turn on/off button emulator will be start/finish , also Remember after start emulator for first time you don't need to reOpen it!

Delete all files and directories with extetion .Lock at C:\Users\user_name.android\avd\emulator_name.avd\files.Lock and try Again.

Go to Tools>>Android>>Enable ADB Integration select this, It worked for me.

make sure sdk and avd manager added to your IDE correctly.
answer of your second question is,when you play your app in IDE a emulator will be run and on emulator toolbox you can turn off or turn on your emulator and also you can see your app running or not

I meet this situation today, but the file *.lock was deleted (not by me) when i run this emulater failed with error tips like
AVD Nexus_5_API_21 is already running.
If that is not the case, delete the files at
C:\Users\S****.android\avd/Nexus_5_API_21.avd/*.lock
so in the end, i duplicated this emulator and located the copy emulator's location and find the .*lock file and then i deleted it and it worked.

Related

Android Emulator closed because of an internal error: GPU Found

I haven't been on Android Studios in a number of days. When I went back on my emulator kept getting killed. I deleted all my emulators and the AVD manager folder in .android. After selecting that the emulator graphics be Software GLES 2.0 the emulator works and can run the application but it is very, very slow. Only a week ago the emualtor and Android Studios worked great.
I am receiving this error messaging now after re-installing an emulator with API level 28 (Pie):
Answer that work [28. July 2021]
First of all update your graphic card with the latest driver. (Graphic Card Model can be checked through your Device Manager)
Type in your explorer the following path, where <pc_name> need to be replaced with your individual name:
C:\Users<pc_name>.android
In the above mentioned directory we will put a .ini file that I prepared and is ready to download here. This file will disable your Vulkan driver and enable your GLDirect driver that your AVDs don't lag anymore. (watch image below)
Start your AVD and you will be able to use it without any troubles.
There is a missing or corrupted file amdvlk64.dll.I fixed this by given steps.
Download amdvlk64.dll from This Link , this is for 64 bit OS, you can search fro 32 bit also.
After Download, extract the folder on your desktop.
Open Extracted folder and Copy the amdvlk64.dll file.
Now Paste this file in C:\Windows\System32
Again run the emulator, hopefully it will run.
In my case I resolved this by performing the pending SDK Tools updates in the SDK Manager.
Reference : https://superuser.com/a/1583394/961460
I get this error (Emulator is closed because of internal error: gpu found)
suddenly while I am running my code. So how I solve the problem is,
Go to AVD Manager or (Virtual Device Manager).
Edit your AVD or (Virtual Device Manager).
Select 'Software GLES2.0' option on Emulated Performance.
Click Finish.
Start AVD again
Download and install this vulkan-dll driver.
There are those who think that the comment I added is a virus, I researched the subject a lot and finally reached the address, almost 48 hours later, so I installed my emulator, my aim is just to help.
For me, the same error showed even though I have NVIDIA GPU.
Restarting the system after the NVIDIA driver update fixed the problem.
I installed Android studio in Windows 10(AMD Ryzen), the following one helped me to run the emulator smoothly. Once you installed Virtual device from AVD manager successfully, then your emulator will popup the above error like Android emulator closed....amdvlk64.dll not found and amdvlk32.dll not found.... when you try to run your code. Just follow this steps to avoid those error, hope it works:
Close your Android studio and also emulator error popup. Go to
Control Panel.
Select Programs --> Programs and Features --> Turn windows feature
on or off (which lies in the extreme right side of the screen).
A popup appears, in that check the Windows Hypervisor Platform and
Virtual Machine Platform, then click Ok.
It ask you to restart your system, allow to restart.
After restart, now open Android studio and run your emulator, hope it will
run smoothly.
At times the error might be caused by the wrong system date/time set on your computer. Try updating the system date/time and restart the android emulator. In my case it was caused by the wrong system date/time.

Failed to launch emulator: Error: Emulator didn't connect within 60 seconds

I'm unable to debug using VSCode for Flutter. I'm using Windows and I'm trying to use an Android emulator.
I have attempted to reinstall Flutter, Android SDK and VSCode to fix the issue, as well as tried setting environment variables.
This is the error that I get when launching debug mode.
Failed to launch emulator: Error: Emulator didn't connect within 60 seconds
Are there any better emulators that I can use for both Android and IOS, because I don't even know where to begin with IOS emulators. I'm new to app development and want to get started making applications for both devices.
i had same problem,
i tried to stopping emulator based on Answer of Rahul Shukla:
Steps:
Open Android Studio
Tools -> AVD Manager
Virtual Device -> Actions (Refer Image)
Click On Stop
Now Start Emulator
Now it's working fine :)
but it not work for me.
i test another way. i use these steps:
Open Android Studio Tools -> AVD Manager Virtual Device -> Actions
Click On Wipe data
Now Start Emulator and Enjoy it!!
Steps:
Open Android Studio
Tools -> AVD Manager
Virtual Device -> Actions (Refer Image)
Click On Stop
Now Start Emulator
Now it's working fine :)
Adding the following variables to $HOME/.bash_profile solved my problem
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
Open Android studio and go to AVD manager.
Click on stop
Click on wipe data
Click Cold boot
I've added a user environment variable:
Name: ANDROID_HOME
Path: Your android folder path, personally it was D:\Android
and restart.
Hope it ll work for you.
For android emulator there are alternatives like geanny motion.
Since you have AVD installed you could try running from the command line.
run flutter devices to get the list of emulators and their id.
then run (assuming emulator-5554 is you emulator id) flutter run -v -d emulator-5554
Finally you the option of starting android studio then start your emulator,form the IDE and the run the above command or you even run the app from the IDE.
For anyone struggling even after trying with the other solutions. Try:
Quit VS Code
Open your terminal and run adb kill-server
Open VS Code again and attempt to run your app on your emulator.
This is what worked for me. In Android Studio, go to Settings, and select HAXM.
Then go to Tools, AVD Manager, and click on the Play button to start your emulator.
Also, make sure you have enabled Hardware Acceleration in your BIOS, if you have not done so yet. Check this post for this matter:
Error during installing HAXM, VT-X not working
Approach of wiping data listed above worked for me , i mentioned those in steps :-
Steps:
1.Open Android Studio
2.Tools -> AVD Manager
3.Virtual Device -> Actions
4.Click On wipe data
5.Now Start Emulator
6.Now restart the pc
Restarting the pc is not necessary i just did it as a follow-up,
although make sure your android studio is updated because in my case AS was not updated so i think my emulator was not working and VS Code was throwing errors .
Try restarting your PC once! It worked for me!
I had the same issue on Linux. I resolved it by disabling hardware acceleration for the emulator:
Android Studio -> AVD Manager -> Edit emulator -> Emulated Performance: Changed from Hardware to Software.
Update:
It turns out that while Flutter is unable to launch emulators with hardware acceleration, they launch with acceleration just fine from Android Studio or with the emulator command.
As of April 2020 you can override emulator launch commands for Flutter in VS Code.
In VS Code settings you can search for dart.flutterCustomEmulators, or directly populate your settings.json like so:
You can get the emulator ID with the flutter emulators command:
Now when you choose this emulator in VS Code it will use the emulator command from the Android SDK rather than the flutter emulator command it usually uses, and it launches and connects successfully as expected.
Here are the reasons I had
Out of disk space.
Android Studio didn't launch. I immediately started looking for the problem in VS.
You can try to wipe the data of the particular device.
Go to -> Android Studio -> Tools -> AVD Manager -> [Select the down triangle on your chosen device] -> Wipe data.
Now retry.
I am using Genymotion 3.0.2., VS Code (version 1.36.1)
You can read about it here - Using Genymotion Emulator with Flutter in VS Code — (Without Android Studio)
Open up Genymotion and go to the ADB Setting section:
Notice how the default selection is “Use Genymotion Android Tools (default)”? With this selection, the emulator is not recognized.
Change it to “Use custom Android SDK tools”, set the SDK location to where your SDK is (in my case it’s at “C:\Program Files (x86)\Android\android-sdk”). Make sure the tick mark (“This folder is valid”) is displayed.
Close the settings box.
Now reload your “VS Code” IDE.
The problem for me was that Intel HAXM wasn't installed. When I opened AVD Manager through Android Studio and tried to launch the emulator from there (instead of trying through VS Code), it told me that HAXM was required and prompted me to install it. After Android Studio installed HAXM successfully, I could run the emulator from VS Code without any issues.
Just restart the PC, works every time. It is that simple.
Check if it already running. Find qemu-system-x86_64 (or similar) on windows task manager, choose end task. Try launch it again.
Make sure that vt-x is enabled in your bios
For me "wipe data" by going into :
Android Studio
Configure
AVD Manager
Wipe Data
Didn't work.
So I did it the hard way :
Delete the emulator
Create a new one.
You should increase the internal memory of your device.
You need to first install android studio.
Follow these steps (Works for Android Studio 3.5.1)
Choose "Run" in the top menu bar
Press on "Select Device"
Select "AVD manager"
There will be a popup now for creating your virtual device.
For me, it was "Not enough disk space". Generally, in these situations, you can run Android studio then Tools-> AVD manager and start manually.
If there is a issue then you can see the actual in android studio logs.
Mine was similar but for iOS and it said Failed to launch iOS Simulator: Error: Emulator didn't connect within 60 seconds . I closed all instances of VS Code, opened the project again and this time it worked.
I also had the same problem above when i freshly install AVD API28. I tried all posted solutions in this thread and they didn't work for me.
So, I go to android studio --> AVD manager --> Click the green play button(Launch this AVD in the emulator).
then VSCode can detect the emulator and it works fine.
But, I think it will need to run AVD manually every time we wants to use the emulator.
I am encountering the same problem with the emulator that it is not starting and says:
"Emulator didn't connect"
Solution:
Make sure that your virtual technology (Vf-x) is enabled in the bios
setting.
This solves my problem.
For me, this was happening quite often and cleaning cache was a bit hectic for me as I had to download few files again and again.
What I did was, stopped the AVD from Android Studio
Then, I ran flutter run from VS-Code and it worked!
delete AVD and create a new one worked for me.
For some, it might be problem of the emulator and Android API itself.
A duplication of the problem mention in Can launch, but not connect, to emulator in VS Code and Android Studio using flutter.
I sort it using a API 29 instead of 30. Since API 30 (in Pixel 4) skipped the allow debug mode.
Hope it helps for some of you.
It was a storage issue for me. Had to clear up space by deleting junk files and I was able to restart my emulator.
I am using Lenovo V15 laptop.
I chose extreme performance from bios settings. And I encountered this error.
When I select intelligent cooling, the problem was solved.
In a nutshell,
Replace 'extreme performance' with 'intelligent cooling' in the bios.
Follow these steps:
Find qemu-system-x86_64on Task Manager and end task
Open cmd and execute this command adb kill-server
It works for me. Good luck

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

Waiting for Target Device to Come Online

I recently updated to Android Studio 2.3, and now when I try to run the application, the emulator does not come online. It times out after 300 seconds.
Additionally, The app has been experiencing a FATAL EXCEPTION ERROR (OOM), and I am not sure how to fix that either, or if that is part of the emulator problem.
Any help is much appreciated. Again, my knowledge in the program is very limited so if your answer can be kept simple, that would be great.
Following worked for me on Android Studio 3.x.
Step 1:
Open AVD Manager.
Step 2:
Right click and Wipe data for the virtual device you're testing on.
I too had the same problem, then I went to AVD manager and right click on the emulator and stopped it and I RUN the application again and this time it worked.
It may be a temporary solution but works for the time being.
Tools -> AVD manager -> right-click on the emulator you are using -> Stop
Now Run your application again.
Note: Sometimes closing the emulator directly is not working for the above-mentioned problem but stopping it from the AVD manager as mentioned is working.
In case you are on Mac, ensure that you exit Docker for Mac. This worked for me.
Three days on this, and I believe there's a race condition between adb and the emulator. On a request to run an app, with no emulator already running, you see the "Initializing ADB", then the emulator choice, it starts and you get "Waiting for target to come online". An adb kill-server, or a kill -9, or an "End Process" of adb with the task manager will cause adb to die, restart, your APK installs and you're good to go. It does seem funky to me that an "adb kill-server" causes adb to die and then restart here, but that's another mystery, maybe.
Another case is Android Emulator should be reinstalled. This can happen, when you install a higher version of Android Studio, then update SDK for it, and go back to previous one.
Tools - Android - SDK Manager - SDK Tools - Android Emulator -
uncheck, apply, check, apply
Disable Docker app if you have it (Mac users).
Restart emulator:
Tools - Android - AVD Manager
(or kill adb process in task manager).
Go to AVD Manager in your Android Studio.Right Click on your emulator,and then select wipe data.Then run your app again.
The emulator will perform a clean boot and then install your apk then your app will finally run.
Summary:AVD Manager---Right Click Emulator----Wipe Data----Run App Again
If the problem presists,then simply go back to your avd manager ,uninstall emulator,then add a new emulator.Once the new emulator is added,in your avd manager,run the emulator...Then run your app.
Its much simpler if you have an emulator already running from the onset before running your application for the first time
After trying all these solutions without success the one that fixed my problem was simply changing the Graphics configuration for the virtual device from Auto to Software (tried hardware first without success)
This solution works for me :
Tools -> AVD Manager -> click drop down arrow -> select Cold Boot Now
Below steps work for me
Close running emulator
Go to AVD Manager
Choose available emulator
In that action tab (last one), click on drop down arrow & select COLD BOOT NOW
Finally run your application
Seems like Android Studio (using version 3.5.1) gets into a weird state after a while. This worked for me.
File -> Invalidate Caches / Restart -> Invalidate and Restart
Go to AVD Manager right click on your device and select Wipe Data and Cold Boot Now.
For me it worked correctly.
After trying almost all the solutions listed above, what finally worked for me was to create a new virtual device using a "Google APIs" image instead of a "Google Play" image.
Seems that in my case the problem was in that the "Google APIs ARM EABI v7a System Image" wasn't automatically installed during installation of Android Studio.
After installing the image, the emulator began to work.
Screenshot of the SDK manager
Did not read all the answers. Anyway Accepted one didn't work for me. What did was upgrading the android studio to last stable version and then created a new virtual device. I guess my nexus 5p virtual device got out of sync with the android studio environment.
This worked for me on Android studio 4+ and Mac OS
Delete all AVD's that you currently have.
Go to Preferences > Appearance & Behavior > System Settings >
Android SDK > SDK Tools
Uninstall Android Emulator
Restart Android Studio.
Re-install Android Emulator from the same place.
Create a new emulator!
I discovered that having a running instance of Docker on my machine (OSX) prevented the Android Emulator from running (see Android Studio Unable to run AVD)
Previously, my emulator would appear to start, then fail before any device window was shown.
I also had to use 'kill -9' (as per #MarkDubya ) to get Android Studio to connect to the virtual device.
Like urupvog's answer, make sure that you aren't running any other virtual machines like VirtualBox. When I restarted my computer, AVD worked until I started Vagrant for backend development (then it wouldn't launch).
See Android emulator and virtualbox cannot run at same time for more info.
Check you don't have the deviced unauthorized, unauthorized devices reply the same error in the Android Studio, check the emulator once is on with the adb command.
$ adb devices
List of devices attached
emulator-5554 unauthorized
If you have of this way the emulator the Android Studio is waiting for be authorized and maybe this can solve the problem.
Authorized Devices
This is a error I have solved in Windows 10 with Android Studio 2.3.3
Fix for this issue is simple :
Go to SDK tools > SDK Tools
Check Android Emulator and click Apply
and sometimes you might see there's an update available next to it, you just need to let it finish the update
For those stuck on this problem on a device and not the emulator, make sure your app isn't set as the device owner.
Question is too old but may be helpful to someone in future.
After search many things, most of them is not worked for me. SO, as per my try This solution is worked for me. In short uninstall and install "Android SDK Tools" in Android SDK.
Few steps for that are below:-
go to "SDK Manager" in Android Studio
go to "SDK Tools" tab
Uninstall "Android SDK Tools" (means remove check(uncheck) ahead of "Android SDK Tools" and Apply then OK)
Close and Restart Android Studio
Install "Android SDK Tools" (means check ahead of "Android SDK Tools" and Apply then OK)
Image of Uninstall and Install Android SDK Tools again
The problem is that there is no link between ide and the emulator.
In our case - we lowered version of android for the app, that frustrated ide in emulator linking.
If we install Android 25 and bind project to it, and AVD Device on Android 25 as well - it links and apllies changes on the fly. If we downgrade to Android 14 and device on android 14 - it doesn't.
Used Android Studio 2.3.
To play with versions you can set in Gradle Scripts - build.gradle (Module: app):
android {
compileSdkVersion 25
defaultConfig {
minSdkVersion 15
targetSdkVersion 15
}
}
As a result app won't run on an Android 25 device with a message:
Installation failed with message Failed to finalize session : -26:
Package ru.asv.test new target SDK 15 doesn't support runtime
permissions but the old target SDK 25 does.. It is possible that this
issue is resolved by uninstalling an existing version of the apk if it
is present, and then re-installing.
WARNING: Uninstalling will remove the application data!
I also ran into this problem and probably found the solution that may help. The key is launching the AVD in the emulator first then run your App.
Following are the steps:
In the Your Virtual Devices screen, select the device you just created and click Launch this AVD in the emulator
Once the emulator is booted up, click the app module in the Project window and then select Run → Run
In the Select Deployment Target window, select the emulator and click OK.
For Linux users using KVM and facing this problem try setting the Graphics option on the Android Virtual Device to Software instead of Automatic or Hardware . As previously mentioned in this answer.
I can confirm that the method works for Arch Linux, Ubuntu 16.04, as well as windows with or without a proprietary graphics card using Android Studio version 2.3.1+
I am working on notebook, Windows 8. I solved this issue change mode from battery saving mode to balanced mode. Before that, an emulator didn't work and I see "Target Device to Come Online". Also didn't work Genymotion
I had a similar problem when updated my android studio. Somehow it changed my SDK path. I just changed it to my updated SDK path and it worked.
Android Studio -> File -> Settings -> Appearance & Behaviour -> System Settings -> Android SDK
Here you will find Android SDK location just click on edit link in front of that and browse and select the Android SDK from the file browser. Select and click on Apply.
Select AVD manager and start Emulator. This solution worked for me.
Go to terminal and type android avd. Select your AVD and select "Edit". Make sure you do not see No CPU/ABI system image available for this target - it will show in red font at the bottom. Change the target to the one that is available or download the ABI image. Sometimes, if you create an AVD from inside Android Studio, it does not ensure this requirement.
None of solutions above worked for me, so I had to wipe content of
C:\Users\your_name\.android\avd
and re-create emulated device
I've had the same problem (AVD not coming online) in a Linux system. In my case, I have solved it setting this environment variable:
$ export ANDROID_EMULATOR_USE_SYSTEM_LIBS = 1
This case is documented here: https://developer.android.com/studio/command-line/variables.html#studio_jdk
Finally, I solve this problem by setting the right export path in bash file:
export ANDROID_HOME=/Users/[username]/Library/Android/sdk

Android emulator crashing on Mac

When I try to launch Android emulator, it crashes on Mac OS X. It was working some time ago, but now it isn't and I don't have an idea why.
Crash log: http://pastebin.com/04MjCqaS
Terminal log in verbose mode: http://pastebin.com/L6y6rUr0
Same issue here, I'm running a mac mini with 8GB of RAM and MacOS Lion. It used to work with the old AVD with some random crashes every now and then but since the last update to APi 17 it's a pain in the neck.
The ADT bundle doesn't work at all. After tweaking the memory limits on eclipse.ini file it throws random memory errors. Also it's not been able to download and install the m2e (maven to eclipse) plugin.
I moved to IntelliJ and I'm able to launch AVD manager but none of the "old" created devices work. If I create a new one and I launch it it works until I close it, then I have to restart the Mac and create a new device. Also it randomly shows errors when I want to delete those old created virtual devices.
Also the DDMS fails to start. I launch it, shows its icon on the Dock but it doesn't respond until I force close.
What a Nightmare.
** EDIT **
I found at android dev bug tracker this issue when you're running 2 screens: here
This is happening to me with the android emulator. I solved it like this:
cd ~/.android/avd
ls *.avd
Now choose the emulator that is crashing and
cd name_of_the_emulator.avd
touch emulator-user.ini
vi emulator-user.ini
And now reset window.x, that's window.x=0
exit and run the emulator.
If you move and close the emulator to the secondary screen it will crash the next time you want to run it.
Kill your Docker process
One problem I have seen multiple time is with Docker. Android Emulator crashes when Docker is running on Mac.
I was following the PhoneGap "Getting Started" guide for Android, and when I got to "Deploy to Emulator," after I created a new AVD, my Mac would crash and reboot. I stumbled on this thread, but thought it worth mentioning that what actually solved the problem for me was an Intel patch for the Hardware Accelerated Execution Manager located here: http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager
This is because Android SDK use some deprecated libraries of Mac OS X. I have the same problem (sometimes even kernel panic) before I start use android device. Maybe in future versions of Android SDK this problem will be fixed.
I just updated the Android SDK manager to the latest Android 4.2 (API 17) level updates, and now all my old AVD's crash. The newly created one using API 17 works, however.
I have the same issue. You can try to create a new AVD with the appropriate API level. I am able to run these the first time(s) after creating. That seems to be a memory error.
My AVDs are able to run the first time after reboot. After this they keeps crashing.
I had the same issue using mac 10.6 and 2 monitors one through a usb adapter to HDMI.
I have tried all of this suggestions and nothing did work.
I ended up creating a new user into my mac and with the same android sdk and same eclipse with a new workspace did work.
I'm not sure whether just creating a new workspace would do the tweak, I didn't try it.
for those who come across to this annoy issue worth to try it before switch to a new account.
You can delete your emulators from ~/.android/avd
Then create new emulators.

Categories

Resources