I am working with Ionic Cordova project and trying to run emulator. I am using trial version of windows 10 pro, till now didn't put license, it is trial only. though Android studio, Java sdk, and Android-SDK installed correctly but when trying to start emulator (for a correctly created virtual image) it is failing to start. It is visible for 1 seconds after that it is never visible. In-fact event viewer also not showing any error log. is it due to trial version of win 10 pro? I have no clue why it is happening?
I have tried by both installing hyper-v and once unstalling hyper-v, but none worked. I am not sure if hyper-v feature should be on or off. What is correct way?
How did you install the emulators and SDK exactly? What Android SDK version is the emulator based on? Are you really using Visual Studio and the Tools for Apache Cordova? What VS version, cordova and cordova-android versions?
If you see emulator icon, but don't see window, just recreate emulator. This is because of bugs with emulator position (when emulator window is off-screen).
Anyway, try recreating virtual device
Related
I have a question about running an app through the emulator on android studio.
My emulator device is able to turn on, but when running the app, install never completes so the app times out. I have tried invalidating cache and restarting, and I have installed the sdk platforms that are the same as the emulators and project, but these changes did not work. My computer cannot install emulator hypervisor driver for AMD processors or intel x86 Emulator accelerator, but I don't think it is necessary for the app to run since my emulator can turn on, right? also, any app has never successfully run on android studio.
The is no code other than the hello world that comes up automatically. This is an empty project with a minimum sdk of api: android 4.1. The device I am using is a pixel 2 with an api of 22. (size on disk 3.5 GB) for tools, I have android SDK build-tools 33, android emulator (31.3.10), and android sdk platform- tools (33.0.3) installed.
I have tried every forum that has the same issue as me but if you think there is one that can help me, please share it thanks.
Android Emulators aren't always the best so expect random failures. This is what I would try:
Make sure the app compiles properly (make sure you see BUILD SUCCESSFUL in your bottom "Build" Tab in Android Studio)
Make sure you have updated Android Studio and Android Emulator, Android Build Tools, SDKs etc.
Create and use a device with a higher API version. Ideally one with Play Store.
Depending on your development machine you might want to try a different architecture (ABI). Try x86 or x86_64 instead of what you've already tried.
In rare cases your existing emulator images get corrupted. Uninstall them in your SDK manager (Show Package Details) and install them again.
If possible try running the app on a real device (follow online instructions to enable USB debugging etc.) to verify the emulator is the problem.
I am new to Xamarin. I used Xamarin. Forms template to create a sample mobile solution in Visual Studio 2017. The process created four projects Xamarin PCL, Xamarin Android, Xamarin.iOS and Xamarin.UWP. Without making any modification to the generated solution, I am trying to run it.
The first issue is, when I set the UWP as the starting project, the Windows emulator shows up and runs the app perfectly. But when I try to do the same with Android, I get different errors at different times based on the environment changes I make. Finally, using the visual studio android emulator, the Phone UI shows up but not my app. In the background, I can see that Visual Studio completed the build process successfully without any errors but the deploy process simply hangs. I left the deploy running overnight but still running in the morning. Here is my environment.
Intel Core i7 processor
Virtualization enabled in BIOS
Windows 10 Education
32GB RAM
Hyper-V disabled in Windows
Executed bcdedit /set hypervisorlaunchtype off in the command window and rebooted.
I tried setting the above environment in different combinations but none of them seem to make the app work. When I use an android emulator from android SDK, the build process throws errors. The only emulator that even builds is the visual studio emulator. But the deploy hangs.
A second issue I have is, I have installed android SDK for version 24 and 25. But in the emulator dropdown, I can only see the emulators for 23. I checked the installation path both in visual studio and android SDK manager and they both point to the same installation folder. What do I need to make the emulators for version 24 and 25 usable?
I repeat, I did not make any change to the generated solution in visual studio before running it. I have been at it for the past three days and couldn't make it work. Please help.
I just installed Visual Studio 2017 (on Win10 15063.138) and found, like you, Xamarin projects won't deploy to Android. Here's how I got running:
Updated everything in the Android SDK Manager.
Installed the new, improved Android Emulator from MS:
https://www.visualstudio.com/vs/msft-android-emulator/
Used that to download/install an API level 23 (6.0 Marshmallow)
emulator
Started that emulator using the same tool (you'll see it running in Hyper-V Manager)
Selected same emulator in VS for deploy/debug (the emulators that ship with VS are painfully slow)
In VS, selected Android project for start-up and verified build and deploy to Android in build config mgr.
Note: MS doesn't appear to have any emulators above API level 23, so Compilation and Target settings for your Android project can be the latest, but the minimum target will have to be 6.0 (API 23).
After pulling my hair for the past few days, I finally got my Xamarin.Forms Android App to show my page on the emulator. Thanks to all the members for their suggestions. Ryan's suggestion helped a lot ( I +1ed him, thanks Ryan) but did not solve my problem. I googled further and found a suggestion that asked to change the following setting which did it for me finally. So, if anyone else get stuck like I did, please do the following (in addition to cleaning up and updating all packages):
Open up the setting for your Hyper-V vm for your emulator (while the VM is off).
Expand the Processor node on the left and click on "Compatibility".
Now put a check mark on "Migrate to a physical computer with a different processor version" on the right.
Start your emulator in the Visual Studio Emulator tool.
Now, start debug your android project in VS using the same emulator that is already running.
After a delay (there is always a delay), your app will show up on the emulator. Yey!!
I've setup the latest Xamarin Android Player (XAP) on my AMD64 server running Windows Server 2012
Hyper V has been uninstalled.
Before doing so I uninstalled Virtual Box and let XAP install its version.
When I start XAP with device Nexus 7 Lollipop it boots to the Android logo and goes no further.
What is wrong?
You need to post errors and logs.
VirtualBox should be installed I believe for the Android Xamarin emulator to work.
However, you could try reinstalling the Android player. Make sure virtualization is enabled in bios.
If worse comes to worse, you can install the Android AVD manager and use the normal Android emulator which also works on Xamarin.
The Xamarin Android Player is still in preview, any issues with can be addressed with bug report at https://bugzilla.xamarin.com/newbug
Please include the logs when you file a bug, you can generate logs by Right-click bottom bar > Generate Bug Report
In the meantime, I would recommend you to use Visual Studio Android emulators
In addition to what Prashant suggests, you can also try a different simulator image. Some of the XAP device images seem to be unable to boot properly on some machines. I've not seen any issues under OSX version of XAP, but the Windows version seems to be affected on some systems.
I am using Android Studio 2.0 Stable version. Whenever I click on the play button on the device to run it shows starting AVD progress in android studio and after completing it's progress nothing happened.The app window remains as it shown in screenshot and the emulator doesn't start. I can't find a solution for this issue. I have already tried many solutions which I found on the internet, changing HAXM version android SDK update, changed target API's. But nothing works.
Try edit AVD Settings -> Emulated Performance -> Graphics. Set Software - GLES 2.0.
Installing the Android Emulator (marked in to the image) solved my problem. If still you face face problem install API simulator and DHU emulator too. But only AE will solve the issue I guess.
I had exactly the same issue.
Windows 7 Professional SP1. Installed Android Studio 2.0, new HAXM ver 6.0.1 and updated to all new components like SDK tools 25.1.1.
When started - emulator do not shows up any window. 'emulator.exe' runs in the task manager and eats 25% of CPU.
Deleted all AVDs, re-created new; used AVD Manager directly; used ARM/Atom images (with/without HAXM); tried AVD with different API level - nothing helps.
Reverting to Android SDK Tools 24.4.2 helps - I can run emulator as usual - so, looks this is not the issue of new HAXM 6.0.1.
After day fighting finally got resolution:
I have removed C:Windows\System32\Wbem from system PATH variable.
I had the same problem. I just created the AVD with 768 MB RAM and it did run fine!
I have the same issues as you. I upgraded Android Studio to 2.0 stable which also updated the Android SDK.
I believe this issue is more of an Android SDK issue since using the SDK's AVD Manager directly I can replicate the issue.
As another data point, I've also modified the Virtual Device to only use 768MB RAM, to no effect. The Task manager shows the emulator using 2 threads and 13% CPU no matter how long I leave it running, but no window ever appears. I've tried with and without the HAXM. My virtual devices are running API level 21 (x86_64) and 19 (x86).
I've also reinstalled both Android Studio and the Android SDK without any affect. It could be a configuration issue due to the 2.0 and SDK upgrade, a broken SDK release, or something else entirely.
Reverting to Android SDK 24.4.1 allows the Emulator to start working again, but without the 25.1.1 functionality.
open cmd
type set and check if you can see C:\Windows\System32\Wbem in PATH variable
go to Control Panel -> System (on the left)->Advanced system settings -> (button at the bottom) Environment variables
Either in user variables (or more likely system variables) in variable PATH remove
%SystemRoot%\System32\Wbem (or C:\Windows\System32\Wbem)
restart studio
I stumbled upon the same problem. I checked SDK manager, turns out emulator has not been installed. After it's been installed, emulator start showing
I recently got into Xamarin development. I have a lot of experience in Xcode making iOS apps and the iOS side was very straight forward. Now I'm trying to implement Android. I downloaded a Hello World example to get my bearings. When I run it I have no problems getting the simulator to show up (MonoForAndroid_API_10 and MonoForAndroid_API_12) but the actual application doesn't run, and does not show up anywhere on the simulator. Essentially whenever I use run or run with in Xamarin on Android, it pulls up a fully functioning, albeit empty simulator.
How do I get my application to run on the emulator?
Like the other commenters, this is most likely just a symptom of slow emulator on your machine. I'm running Xamarin-Android development on my 2010-era OSX machine in mavericks with 8GB RAM, and it is slow-slow-slow, but usable. Try to find the Intel x86 speeds improvements (look for HAXM) and you will find that the emulator will be much much faster.
And yeah, get a real handset and plug it in to your computer: always much faster than emulation.
later edit Get Genymotion for Mac OSX or for PC/Windows or PC/Linux. It's way way way faster than the other emulators. I have since found that this is as fast, or faster, than running the App on my connected Android phone. It's certainly simpler in not having to have the device plugged into one of my USB ports, and allows me to code and test on the train. http://www.genymotion.com/
Don't know if my issue was the same but finally this troubleshooting helped me to run emulator https://msdn.microsoft.com/en-us/library/mt228282.aspx#ADB.
I was missing key Android SDK Tools with string value Path in registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node
I've created it manually and it worked.
UPDATE
Before I got the issue with running emulator, I couldn't see it in Visual Studio. The reason was I've installed VS Android Emulator through standalone installation, not through VS Installer. It had to be installed there as well.
I had the similar issue, and then I deleted the existing device simulator and reinstalled again and it started working.
As I use a different SDK, in my case
Go to Tools > Options > Xamarin and set the Android SDK path.
Sometime Visual Studio changes this configuration;
2020 Update:
I followed the most voted comment, however, with Visual Studio 2019 updated recently, the steps have changed a little. Here is what previously worked:
WHAT WORKED BEFORE
"Don't know if my issue was the same but finally this troubleshooting helped me to run emulator https://msdn.microsoft.com/en-us/library/mt228282.aspx#ADB. I was missing key Android SDK Tools with string value Path in registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node
I've created it manually and it worked."
WHAT TO DO INSTEAD
Nothing. Don't mess with the path.
WHAT WORKED BEFORE
"Before I got the issue with running emulator, I couldn't see it in Visual Studio. The reason was I've installed VS Android Emulator through standalone installation, not through VS Installer. It had to be installed there as well."
Previous instructions image
WHAT TO DO INSTEAD
a. Go to Tools located at the top of the VS window, Get Tools and Features, go to Individual components, using the search tool in the pop up box, search "emulator", once you get the result, make sure both Google Android Emulator (API Level 25)(local install) and Intel Hardware Accelerated Execution Manager (HAXM) (local install) are both checked.
b. Close the solution(s) and restart VS then reopen the solution(s).
c. To deploy the app on the emulator, click Start button to spin up the emulator, left click on your Android project, then click Deploy. You should be able to see your app on your emulator's app menu.
Updated Instructions image
Worked for ME
Sometimes you close the android Emulator but not POWEROFF the Emulator.
this problem happens when emulator shutdown un-properly.
Restart Your EMULATOR
First start your emulator
Then restart your emulator by pressing down the power button and select restart option in your android emulator.
I enabled Hyper-V acceleration based on microsoft documentations: https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?tabs=vswin&pivots=windows#accelerating-with-hyper-v
Basically you need to turn on these two windows features from the control panel (Turn windows features on of off):
Hyper-V.
Windows hypervisor platform.
then from visual studio go to: Tools >> Android >> Android SDK manager >> Tools >> make sure that "Android emulator" version is 27.0.1 or higher, if not, you will find in the same screen a button below to update it.
I did this on windows 10 64-bit, with VS 2017 Community 15.9.5