All AVD images work on my machine except for Android 9.+ (Google Play) & Android 9.+ (Google APIs) (the Android Studio emulator for Android Q beta).
I just downloaded the most recent images. From android-Q/google_apis_playstore/x86/build.prop:
ro.system.build.version.incremental=5506116
ro.system.build.version.release=10
ro.system.build.version.sdk=28
I am using Android Emulator version 29.0.11.
However, when I start these up, I see the device frame with a black screen. I get no error message, just nothing. It stays like this indefinitely.
Is there any way to debug this or is this a common issue?
Update: on another device (same image), I got the following screen instead of a black screen, however, there is still nothing I can do:
You need to configure correctly the Hardware Acceleration for your Emulator. Please, follow these steps:
1) Install the Intel HAXM driver if you are on Windows and have Intel, follow these steps:
Open the SDK Manager.
Click the SDK Update Sites tab and then select Intel HAXM.
Click OK.
After the download finishes, run the installer. Typically, you can find the installer in the following location: sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-android.exe
Use the wizard to complete the installation.
After installing Intel HAXM, confirm that the virtualization driver is operating correctly by entering the following command in a Command Prompt window:
sc query intelhaxm
You should see a status message that includes the following information:
SERVICE_NAME: intelhaxm
...
STATE : 4 RUNNING
...
For Linux, check this link
For Mac, check this link
2) Open AVD Manager on Android Studio:
Edit the Virtual Device where you set target Android Q
Click Show Advanced Settings.
Set Graphics to Automatic or Hardware.
In my case all other emulators started, except Q. I have all needed SDK and AVDs.
But every time emulator didn't start without any error.
I saw Emulator in Android Studio doesn't start and found a way to understand a reason. I started from avd path:
D:\Android\emulator\emulator.exe -avd Pixel_2_API_29 -netspeed full -netdelay none
and got an error: PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [D:\Android]!. In PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value I found that we should read config.ini inside 'Pixel_2_API_29.avd' folder and detect the line
image.sysdir.1=system-images\android-29\google_apis_playstore\x86\
I understood that I missed android-29 image in SDK path!
I knew that moved SDK and AVD folders from C:... to D:\Android, but SDK was kept in two folders.
And I forgot to change one system variable (ANDROID_HOME):
So I changed it to D:\Android and restarted the PC.
After restarting I deleted old SDK folder (in 'AppData\Local\Android'). Then I started again:
D:\Android\emulator\emulator.exe -avd Pixel_2_API_29 -netspeed full -netdelay none
Android 11 (R) emulator was not working for my case. I fixed it with the following steps.
Step 1:
Go to SDK manager -> SDK Platforms and install your required API level ( Like Android 11.0, Android 10.0, etc. For my case Android 11.0 was not installed that's why it was not working )
Step 2: Go to SDK manager -> SDK Tools and install Intel Emulator Accelerator (HAXM installed) if not yet installed. If you are a windows user then make sure that windows firewall is deactivated for a while otherwise it will not be installed and generate an error.
Step 3: Wipe data and Cold boot the device from ADV manager.
If the above steps are not worked then Invalidate caches and Restart your android studio as well as the PC.
I fixed it by reinstalling Android Studio entirely.
Actually, I just wanted to reinstall the Android SDK, however, you seem to need to install a stable version of Android Studio for that. After that, I set everything up the same way again and ran the beta version and now it works.
Had the same problem on macOS. Found out that I didn't have enough space on disk to create 'userdata partition'. So check that.
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
I have a quite big problem as accidentally removed the file, it is already removed from the bin on Mac. Now in Android Studio I cannot run emulator and I get the below message:
Can anyone help me please? What should I do now? Is there any way I can reinstall this missing file for Android studio?
Many thanks in advance!
EDIT: My problem was a missing .exe file: qemu-system-i386. I couldn't find any working solution, tried installing various images versions, was creating new emulators. I decided to uninstall Android Studio and proceed with the new installation. I used a free tool, AppCleaner, to remove the Android Studio, you can read more about this here: http://lifehacker.com/5828738/the-best-app-uninstaller-for-mac. But still had to remove manually the entire sdk tools directory. You can actually do the same from the terminal, here is the thread how to do it: How to completely uninstall Android Studio?
Anyway, the important thing it is working now! :D
1) Open the SDK manager (see the image below):
[
2) Launch the stand alone SDK manager
3) Ensure that you have downloaded and installed the SDKs and tools for Android version that you'd like to emulate. In my case I use API 25. You should also have the Intel x86 Intel Atom System images installed.
4) Then open the AVD Manager and "Create a Virtual Device"
5) Select the API level that corresponds to the one you installed in the previous steps. In the newer versions of Android Studio you can also download and install the System Image you desire in this menu.
I have been working on an android project, I am using android studio on my iMAC[Software OS X 10.9.5, Graphics Intel HD Graphics 5000 1024 MB, Processor 1.4 GHz Intel Core i5].
When i try to open my application on an android emulator it get this error-
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!
I can find so many similar issues with solution on Google & SO, but i am unable to use those solutions for MAC???
I followed all the steps given here but with no luck, still unable to launch emulator. I think there is something to do with mac os.
Can anyone tell me how to do this on MAC ??
Thanks
First, make sure that the Intel HAXM is up to date. You update it by opening the SDK and selecting it in the list. (As of 2016-07-08, the latests HAXM version is 6.0.3).
Then, on Mac, the Android SDK gets installed at: /Users/username/Library/Android/sdk/, therefore, you will need to run the script as sudo, as follows:
sudo sh ~/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh
If all goes well, the script prints the message: "Silent installation Pass!"
Then, restart Android Studio and run your app with the desired AVD.
I know I'm late, but here it goes.
Delete all AVD's that you currently have.
Go to Preferences >> Android SDK >> SDK Tools
Uninstall Android Emulator
Restart Android Studio.
Re-install Android Emulator from the same place.
Create a new emulator. And Voila !
What i personally did, in the process of fixing this.
I actually re-installed entire android studio. Followed this
Fixed my $PATH variables. Followed this
Then i tried re-installing Android Emulator, which worked for me.
Hope this Helps.
Problem in my case turned out to my .zshrc where my ANDROID_HOME was exported to a wrong value. Take a look at your .bashrc or .zshrc
I'm using the new VS Android Emulator with Android Studio:
https://www.visualstudio.com/en-us/features/msft-android-emulator-vs.aspx
It doesn't have Google Play Services installed... so I'm following this guide to install:
https://university.xamarin.com/resources/how-to-install-google-play-on-android-emulator
I've downloaded the proper Gapps file (in my case):
http://www.devfiles.co/download/7m2VdVjQ/gapps-kk-20140105-signed.zip
Now I've dragged and dropped the ZIP file onto the emulator... and it's just stalled at "copying file"... Is there anything else I need to be doing here in order to get Gapps installed? How long does this "install" usually take?
I was trying it out yesterday myself and had the same problem. Apparently, non of the drag and drop functionality worked. So this, is what I did to resolve the issue:
Use the Additional Tools (small >> icon) for the emulator and go to the SD Card tab.
Select a folder on your computer to sync with the virtual SD card.
Pull from SD card, which will create a folder structure on the selected folder.
Now copy the Gapps fill to the 'Download' folder.
Push to SD card. This will take a little while, and copy the zip file to your emulator.
Run a commmand prompt, and go to sdk\platform-tools in your Android SDK location and run adb devices.
If you see the your emulator in the list, then skip to step 9.
If you do not see emulator, run the following:
adb connect <emulator ip>:5555
You can find the emulator ip, from within the emulator, go to Settings -> About Phone -> Status and IP section.
Next run, adb shell. This will give you a prompt to the android emulator.
Confirm the gapps file is there: ls /sdcard/Download
Now run, install_zip.sh /sdcard/Download/<flashablezip>.zip
This should begin the flashing process.
Hope this helps in resolving the issue.
Now you can just drag&drop proper Gapps file to working Emulator and then you should see something like this:
Drag and drop doesn't work if you start the emulator from Visual Studio when you are running Visual Studio as an administrator. To be able to drag and drop run the emulator from the start menu (not as administrator) not from Visual Studio.
It seems that the emulator hangs trying to install files if it cannot find adb.exe.
Ensure you have the Android SDK installed
If you run regedit.exe and look at the HKEY_LOCAL_MACHINE\Software\Wow6432Node\Android SDK Tools reg key, there is a Path string value that points to a location on disk. Double check to make sure that there is a copy of adb.exe located in the platform-tools directory under that path.
Hope this helps.
Found a solution on the web that works. The article suggests it only works for Android 5.1, I haven't tried Marshmallow.
http://www.rajapet.com/2016/03/adding-google-play-services-to-visual-studio-android-emulator.html
Start "Visual studio emulator for android" from the start menu
Create a new emulator for Lollipop, 5.1.1 (API Level 22), start it up
As VS emu runs under x86, we need the "ARM Translator", found on this page:
http://www.techbae.com/download-install-arm-translation-v1-1-zip-genymotion/
([TechBae.com]Genymotion-ARM-Translation_v1.1.zip)
Drag the file to the emulator window, close and restart the emulator if it doesn't automatically.
Install gapps from http://www.teamandroid.com/gapps/, eg gapps-lp-20150314.zip
Just download, drag to emulator, restart
Wait for app optimization to finish
Open Play Store, ignore any errors. If play store hangs, kill it and start again
Sign in
Expand the side menu
Go to settings
Scroll down to Build version, click/tap. You should get a message that a new version of the play store will be installed
Wait for the XDE.exe process to stop downloading
Restart the emulator
Go back to play store, side menu, click Build version - Ensure it is up to date. If not, let it download
Install an app that uses play services, eg Maps to verify
I tried all the previous answers, including the accepted one about running the install_zip.sh shell script, but nothing worked right for me for VS emulators of Android Lollipop (5.1) and Marshmallow (6). The problem seems to be also that Gapps has now some native code, processor specific, and most Gapps packets available for download are compiled for ARM processors. I tried OpenGapps which does have processor specific packages, but their complex installation scripts didn't work for me in VS emulators.
I finally found a Gapps package prepared for ASUS Zenphone 2, which does have an Intel processor - specifically I downloaded the package recommended here, and that installed fine with just drag and drop on Visual Studio emulator for Android 5.1
Following the instructions above, I could NOT get Google Play Store to launch successfully on my Marshmallow 6.0.0 Tablet API-23 VM in VS Emulator for Android.
I've tried all the troubleshooting methods mentioned above to no avail.
What finally worked for me was installing (dragging & dropping) the PREVIOUS version of GAPPS (gapps-lp-20150314.zip) for Android 5.1 Lollipop API-22 in my Marshmallow 6.0.0 VM.
Worked like a charm!
http://www.teamandroid.com/gapps/
http://www.devfiles.co/download/fAgtiEoX/gapps-lp-20150314.zip
Tomasz Cielecki pointed out a solution that involves installing gapps twice.
First install the gapps downloaded from here, reboot the system and then install gapps again with a version downloadable from here.
At least this worked well for me.
You could just use an Android Emulator image (AVD), similar to a VM image, one that has a Google Play services installed. That would be easier than trying to install it in the emulator. Usually, you can see this Android Studio under Tools > Android > AVD Manager and create a Virtual Device and select from the images which has Google Play Services already.
Now Docker + Hyper-V + Android Emulator is possible without needing VS Android Emulator (in fact they seem to be a discontinued job).
Now the Google's emulators work well even with Hyper-V activated.
More info here about how to make it work here (spoiler: it is a simple tick in a checkbox) https://android-developers.googleblog.com/2018/07/android-emulator-amd-processor-hyper-v.html