Xamarin stuck at “Found device: emulator-5554”
I am currently learning Xamarin for Android app development. I installed the xamarin workload for visual studio a few days ago. Today I built a hello world app with Xamarin, tried to run it with an emulator. When I ran the app, everthing went fine until the device loaded succesfully, when the putput window in visual studio said Found device: emulator-5554.
At that point visual studio and the emulator ‘stopped’, not hanged, stopped. The status bar said Ready and the build animation that appears when building a project showed that the process was half completed. I waited for several minutes, but nothing changed. I tried to ‘preload’ the emulator like adviced on other stackoverflow questions, which again didn’t work.
UPDATE: Now Visual Studio is stuck at Waiting for emulator to be ready... which takes forever and never loads.
I work on Windows 10, Visual Studio 2019 Community with the Xamarin workload, along with the default Galaxy Nexus API 23 Android Emulator.
Thank You! Any help is appreciated.
This is a common problem in Visual Studio when you use Android Emulator.
You can try 2 ways for resolve this problem.
First way
1: Go in "Tools", then Android then Android Device Manager.
2: Run simulator
3: Then Start your project
Second way
1: Go in "Tools", then Android then Android Device Manager.
2: Delete all yours Android Simulators
3: Create a new Simulator
4: Run simulator
5: Then start your project
Let me know if works :)
Related
I first tried to run the Xamarin.Forms project in Visual Studio (but the same problem is in Android Studio).
I create "Hello World" on Xamarin.Forms and when I run it, it starts the emulator and then there is only Android System on the emulator, but no my program.
Then I tried to start emulator first, it doesn't work at all.
Then I tried in Android Studio. I created a project and I want to run it in Android Studio and the same happen...
I tried on diffrent computer but it didn't work in the same way...
I have recorded all my steps. You can watch it here:
https://youtu.be/izjNIP56wvI
OK. Solved.
I just installed new emulator. Google Pixel 5.
Then from Visual Studio Device Manager I have installed x86_x64.
And when I started emulator from Device Manager it began to work.
I have tried 5 hours to start this emulator and now it is ok.
The stop button not working and run button is disabled
See the following picture:
I am using android studio on Macbook pro with M1 Chip.
I downloaded the M1 chip-optimized Android studio.
When I run the flutter project on the Android emulator with Android Studio,
It runs fine but after some time If I try to stop the app. It does not stop and if I try to reload it, the reload button becomes disabled.
If I use the IOS emulator, I do not get this issue.
It only happens when I run my flutter project on Android emulators or Real Android devices.
Dart officially supports Apple Silicon, but the one which is bundled with Flutter SDK works with Intel.
I managed to replace it with the Apple Silicon compatible version using flutter_m1_patcher. There are more ways to replace it which you can find here:-
How to replace the bundled Dart SDK in Flutter to run natively on Apple Silicon (ARM64)?
After doing this, I have not faced this stop button issue from last three days. Will update here in case I face the problem again.
Update (15/02/2022)
Life is great after this. Resolves problem for me.
Update (25/05/2022)
Flutter 3 now have Apple M1 compatible Dart SDK bundled into it. Issue is resolved.
Encountered the same issue on M1 Android Studio. Had to force kill the Android Studio process more often.
However, I didn't encounter that issue after updating Android Studio to "2020.3.1 Patch 4" version.
Flutter dev on an M1 machine feels like a hot mess right now. Along with the stop button not working, there are several other related issues I keep running into including multiple dart processes being created in Activity Monitor, getting stuck on building, freezing and the emulator restarting. This requires constant force killing of Android Studio, restarting the emulator and re-building.
One thing I've found that seems to help a lot is making sure the emulator has focus after applying your changes. I have two monitors and keep the emulator on a second screen, so previously I would just run/stop/apply changes in Android Studio and wait for the emulator to update but it would just hang. I noticed that if you cmd + tab to the emulator to give it focus then the changes are applied. For some reason if focus is kept on Android Studio, nothing happens.
It's not perfect, I'm still running into a lot of issues, but it has helped a lot.
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!!
When i try to run Android Studio it gets suspended and not launching.
Link to screenshot
I've tried several things such as:
Cannot start Android Studio. Android Studio stuck at the splash screen
Currently it is not working. It happens to me several times, and i always uninstall it and install older version - then it works. It is really annoying solution, how get this working correctly by not using my solution?
My OS is Windows 7 x64.
Try deleting .AndroidStudio2.3 folder or any version of it from this location C:\Users\UserName\.
I have been using Xamarin to develop some Android applications. I am now using Xamarin with Visual Studio and I have a question.
My question is this... How do I deploy my app to the emulator? I have started the emulator, but am not sure how to do this in Visual Studio.
May I please have some help?
Thanks in advance.
EDIT
I have followed the steps on the page and the steps do not work.
If I do this:
Debug->Start Debugging, the following message appears:
Device: [A]-AndroidAPILevel17NonGoogle is either not running or not attached.
Please attach an Android device, or select an emulator from the dropdown list to launch it.
NOTE : Launching Android emulators can take a few minutes. Please be patient or use a real Android device, they are much quicker!
I can start the emulator by doing the following:
Tools->Open Android Emulator Manager
and then selecting the emulator.
However, once the emulator has started up, I am not sure how to deploy the application to the emulator.
If I select:
Debug->Start Debugging... nothing happens
May I have some help please?