Android emulator in Xamarin Visual Studio does not show the app - c#

I made a new Xamarin Project in Visual Studio , I chose the Single View App .
Then I did not make any changes.
I just pressed the Run Button.
The emulator started ,
but the app was not appeared in the menu of the phone of the emulator.
Is there anyone who know what cause the problem?

On Windows you have a couple of options to accelerate the Emulator. Read more here: https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=windows
Using HyperV: Make sure to install the Windows Hypervisor Platform:
Right click on the Windows button and select ‘Apps and Features’.
Select Programs and Features on the right under related settings.
Select Turn Windows Features on or off.
Select Hyper-V and click OK.
You probably need to restart your computer after.
Intel HAXM: If you are not using HyperV and don't intend and don't run other hypervisors such as VMWare, VirtualBox etc. then you can install Intel HAXM.
In the Android SDK manager, in tools, download Intel HAXM. After that is done, go to the folder where the Android SDK is installed. There should be an extras folder where there will be an installer for Intel HAXM.
On macOS, Intel HAXM is the way to go. Read how to install it here: https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=macos
Should be as easy as running sh ~/Library/Developer/Xamarin/android-sdk-macosx/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh from a command-line.
Either of these approaches should significantly speed up the Android Emulator.
If you have issues deloying to the emulator, sometimes the default configurations have very limited space and installing anything may fail due to the emulator running out of storage. Go to the Android AVD and increase the internal storage size.
For other failures, check the Deploy Output window in Visual Studio and provide more information of what is going wrong. Otherwise it is just a guess.

This might be just a bug. Create a new project. If still blank wait 5 minutes. Maybe your computer is slow so it takes time to load.

If you start using xamarin for the first time
Create device from dropout menu (don't just let it create it from pressing run button).
Select device from dropout menu.
Run up.
if it didn't added just restart Visual Studio (should change "Run" into name of the device)

Related

How to force Visual Studio to use specific Android Emulator?

I have a question about Android Emulator(s) (well, there are actually three sub questions). So, In VS2015 we have two Emulators installed:
On the left - built in Visual Studio Android Emulator (made by Microsoft), using Hyper-V (please correct me if I'm wrong)
On the right - built in.. Xamarin.Studio? Android Emulator (made by Android), using HAXM (please correct me if I'm wrong).
I have a problem, because when you create a Xamarin.Forms project you get this Virtual Device setup by default:
It uses API19, but when I click "Run", it's complies without errors and deploy/run in new Android Emulator (on the right). Why?
When I open Android Virtual Device Manager, selects the same virtual device and click "Starts", it opens the Android Emulator (on the left). Why?
I've enabled Hyper-V for now, my Windows emulators work.
How can I force Visual Studio to run on old "on the left" Android Emulator when I run the project? Can I set this up?
When you open your Android Emulator Manager you will find the following choice
x86 means AVD with HAXM. If you do not have that choice please install image with HAXM
The emulator that create by android emulator manager is Google's default emulators, and Your left side emulator that means the Google's default emulators and with the skin like "WQVAG" or someting others.
Your right side emulator that is created by vistual studio:
when you find the the CPU Architecture is x86 that means it works with HAXM
Use the different AVD Name will clearify which emulator you selected to run.
How can I force Visual Studio to run on old "on the left" Android Emulator when I run the project? Can I set this up?
Select the emulator that create by android emulator manager with the skin.
On the left is an AVD thus it is Google's default emulators. It could be HAXM accelerated if you installed HAXM.
On the right is the VS Emulator for Android created by the Visual Studio team.
You are confusing the built in AVD emulators with the VS Android emulator.
By default whichever Device is selected (Has the green play button next to it) will be used. In your case, you have the VS Emulator for Android selected and thus it will always deploy to that one.
You can use the small down arrow to select another compatible emulator such as the Google emulators if you created a new AVD that is compatible with your project.
See further: https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/debug-on-emulator/android-sdk-emulator/

VS 2015 intern Android Emulator not starting (vmWare 10)

I am running VS2015 CTP6 on a freshly installed and updated Windows 8.1 N x64 VM.
Hyper-V support is enabled, hypervisor.cpuid.v0 = "FALSE"and vhv.enable = "TRUE" are set to vmx-file.
When i try to run the build with a Visual Studio Emulator for Android-device VS will tell me "starting emulator" forever. No error, no window, nothing at all.
The included AVDs (like AVD_GalaxyNexus_ToolsForApacheCordova) start fine, just the new Microsoft VS Emulator for Android isn't working.
After canceling the building-process a message pops up: "Could not start emulated device 'VS Emulator....'" which will now always pop up instantly (after building) if i hit F5. So after canceling the build once VS won't even try to start the emulator again (on that project with that specific emulation-device).
In hyper-v-manager there are no computers at all. \Microsoft Visual Studio Emulator for Android\1.0\ does not contain a XDE.exe but 2 vsemu.vhd's.
I also followed this guide and tried to start the emulator as a standalone.
"pathto\XDE.exe" -vhd "pathto\vsemu.api19.vhd" which will actually start it up and displays "loading" on the emu screen but will crash because i haven't installed the Windows Phone support in VS.
The Visual Studio Emulator for Android can't be run nested inside another VM, particularly not a Hyper-V VM, because the emulator itself is a Hyper-V VM (and Hyper-V doesn't support nested VMs). See the last bullet in "Current limitations" at the end of this blog post.
My emulators disappeared (according to VS) after CTP6 update although all the images, SDKs etc. are still there.
I sorted it with a repair (control panel, programs, vs => modify.) It took many hours do just let it run.
Double check that the VM you are running on has enough memory(emulator will use a lot- and run Procmon to see what VS does and where it fails. Check event log and turn on logging for the VS instance you are using to look for cues.
"The Visual Studio Emulator for Android can't be run nested inside another VM"- is incorrect. My Windows10 VM is happily serving up the emulator for the different platforms and the same goes for Windows 8.1 & 8.
HyperV doesn't seem to be able to support quite yet (AFAIK) but there are other hypervisors you can use such as VMWare player- and from your config edits in the VM I assume you already knew that :)
I'll provide picture proof later (phone only right now so I'll have to edit typos as well later).
Tweaking Virtual Maschine Settings did the trick for me. I was also trying to run the Android emulator by starting a debug session in VS2015 Community for a Xamarin project. VS2015 was running inside a Windows10 VM based on VMware Workstation 12 Pro hosted by Windows7 on a i7 CPU. I ran into the following error message:
"... The Virtual Machine Management Service failed to start the virtual machine 'VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.andreas' because one of the Hyper-V components is not running (Virtual machine ID ...)."
Everything worked fine after activating the following flags in the virtual machine's processor settings section:
Virtualize Intel VT-x/EPT or AMD-V/RVI
Virtualize CPU performance counters
(Preferred mode: Automatic)

xamarin installation and emulator

I have installed xamarin studio in my computer properly. I have checked all installation according to the Xamarin Installer which usually downloads before. I am using window 7.4GB RAM. intel Core I3 processor.
When I select File ==> New ==> Solution and select so c#, F#, and VB.net content is showing.
I am able to select only C# => Android black, ice cream sendwitch .....files only.
How do I create a program for iphone or window phone?
Also if I run code the emulator does not work. The emulator appears but after that no button, label or textbox displays. How do I resolve this?
Read all of this first. http://developer.xamarin.com/guides/cross-platform/getting_started/. Including abilities of IDE on each platform.
Setup Xamarin.iOS on Windows.
http://developer.xamarin.com/guides/ios/getting_started/installation/windows/
I believe that Xamarin Studio does not have iOS support on Windows. To do that you have to use MS Visual Studio, and even then you need Mac to build. In essence, you can't develop for iOS unless you have access to Mac.

Xamarin Visual Studio IOS Development Without a Mac?

I'm a .NET developer and want to write an IOS & Android app in C#. I've had a read around Xamarin for Visual Studio which looks interesting if not a tad expensive!
Do you need a Mac to debug your code? Do you just need a networked Mac to actually deploy the app to the Store?
Is the best option just to buy a Mac and run Windows with VS in a VM or can I just use my windows machine, write & debug the code in Windows then just hook up to a networked Mac for final deployment?
From May 2017, you can develop app without MAC.
Microsoft Xamarin introduce a Live Player. With Live Player, iOS apps can be deployed directly onto an iPhone or other iDevice from a PC running Visual Studio, where the code can then be tested and debugged.
WARNING The Xamarin Live Player Preview has ended. But it changed Hot Reload. With this feature, you can develop iOS app with your iPhone See discussion
See this video: https://www.youtube.com/watch?v=awgZDL1a3YI
this is Live Player Get start section: Live Player
Note: The final build and submission to the App Store will still require a Mac
Device Requirements
The Xamarin Live Player app supports the following devices:
iOS
iOS 9.0 or later.
ARM64 processor.
Check the App Store for a list of supported devices.
Android
Android 4.2 or later.
ARM-v7a, ARM-v8a, ARM64-v8a, x86, or x86_64 processor.
Limitations
There are some limitations on the things Xamarin Live Player can run, including the items below:
Android user interfaces designed with AXML files are not currently supported.
Some iOS storyboard features are not supported.
iOS XIB files are not supported.
Custom Renderers are not supported.
Xamarin.Forms Effects are not supported.
Embedded resources are not supported (ie. embedding images or other resources in a PCL).
Limited support for reflection (currently affects some popular NuGets, like SQLite and Json.NET). Other NuGets are still supported.
Some system classes cannot be overridden (for example, you cannot implement a subclass).
Some platform features that require provisioning can't work in the Xamarin Live Player app (however it has been configured for common operations like camera access).
Custom targets and build steps are ignored. For example, tools like Fody cannot be incorporated.
Yes, you must have a Mac to do Xamarin.iOS development. The Mac is required for building as well as running the iOS simulator. You can either use it as a build server, and actually do your development in Visual Studio (either in a standalone PC, or on a VM running on your Mac), or you can do your development directly on the Mac using Xamarin Studio as your IDE.
You can use Xamarin Studio instead of Visual Studio and build iOS application by C#.
First install VMware Workstation and then download OS X image and run it by VMware.
Then Install tools on it and enjoy.
Tools :
EDIT : The following links are out dated, You must install Mac OS 10.10 in order to be able to install XCode 6.
iOS Tools that you need:
1) Mac OS X image for Windows
Note: Max OS X Installation Help:
http://www.sysprobs.com/easily-run-mac-os-x-10-8-mountain-lion-retail-on-pc-with-vmware-image
2) Mono:
http://download.xamarin.com/MonoFrameworkMDK/Macx86/MonoFramework-MDK-3.2.4.macos10.xamarin.x86.pkg
3) Xamarin Studio:
http://download.xamarin.com/studio/Mac/XamarinStudio-4.2.1-1.dmg
4) MonoTouch:
http://download.xamarin.com/MonoTouch/Mac/monotouch-7.0.4.209.pkg
5) Xcode
Update 2018
Install VirtualBox
https://www.virtualbox.org/
Install MacOs 10.13 on VirtualBox
https://techsviewer.com/install-macos-high-sierra-virtualbox-windows/
Create or login with an apple account on the mac
Install XCode 9.0
https://download.developer.apple.com/Developer_Tools/Xcode_9/Xcode_9.xip
Enable Remote Login
System Preferences > Sharing > Remote Login > Enable for All Users
Configure VirtualBox with an additional network adaptor (host-only)
In Windows > Visual Studio (Xamarin Project) > Pair with mac
Enter the IPaddress of the second network adaptor
Let Visual studio install Xamarin IOS, IOS SDK, additional tools on the Mac
All set up.
An option is to use a remote service to do this.
For example:
http://www.macincloud.com
Anybody know that a Virtual-Machine is the solution! but when you want to have an OSX on windows it's not really easy as you just talked about it.
it's very important to find best OS ROM.
check it out here.
and you have to know that limitation is Apple's doing, not Xamarin's.
As someone that developed 3 Xamarin Forms apps, I would like to bring some points about the options:
Pair with a virtual Mac (VMWare, VirtualBox or cloud)
I worked this way for a while, but virtual machines consume a lot of hardware resources. Paid for a month to use a remote Mac, but the pairing and debugging process does not get much better.
Develop inside a virtual macOS
I have been using this option with good results. I just run everything on the macOS VMware virtual machine. Visual Studio and Emulator got a little slow (my CPU is i5 and 8GB ram), but is acceptable to make some adjusts. Advantages: Avoid pairing, Xcode to edit some resources, publishing.
Install macOS on Windows PC
This is kind of upgraded of previous suggestion. Didn't tested yet, but the performance should be better than VMWare if it works. They call this Hackintosh and is possible if your hardware is compatible.

Debug Application with MonoDroid Trial Version

I have installad MonoDroid Trial Version.
I have create an "Hello Wolrld" application and debug it in the emulator
but any application appears in the list of application on Android Device Emulator!
The problem is the trial version or some error in my application?
Can you help me please???
The Android emulator is somewhat tricky, at least with MonoDroid. Once you execute the application and have selected the virtual device you defined for Monodroid the emulator will launch. Here comes the tricky part, you'll also get a Monodroid "Select Device" window underneath with some slight differences to what you initially had. You should go to that windows and now choose, for example, "emulator-5554" in the running devices list and press "OK". Once you have done that the application should be deployed to the emulator. Slow but it should be deployed.
For increasing Android emulator performance I recommend you to have a look at Emulator snapshots and this article at MoreWally.com.
The bug is described in the following document:
http://support.xamarin.com/customer/portal/articles/141157-ide-does-not-display-target-device
The procedure I use when starting up is:
Close development environment, SDK manager and emulated devices.
Open AVD Manager and start the emulator(s) you would like to use.
Run the command 'adb devices' (located in Android\android-sdk\platform-tools) and note which devices are listed.
If there are none, or the list is incomplete, then run 'adb kill-server' followed by 'adb start-server'. You may wish to create a batch file with these commands.
Now check the devices are visible with the command 'adb devices'.
Open development environment and everything should work.
If you kill or start a new emulated device, when you have VS2010 open, and then devices do not appear as a 'running device' in VS2010, then close VS2010 and perform steps 4 through 6. When you reopen it should now work.

Categories