VS 2015 intern Android Emulator not starting (vmWare 10) - c#

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)

Related

Xamarin Forms - Android App Crashes on Physical device

I am building an app on Xamarin Forms Framework and my app crashes when installing on a physical android device.
It gets fixed when I clear storage and run it again, then my app wont crash and runs good,
But every time i reinstall my app it first crashes.
Another weird thing is Release Built and Debug Built run well on the visual studio debugger.
I am working on trying to fix it all day but no success tried to cancel Optimize my Code, tried to disable link but nothing.
Edit: I use a Mac so I tried to move my project to my Windows PC and released the app to my physical device and it works well, maybe its a Visual Studio Mac Bug?

Android emulator in Xamarin Visual Studio does not show the app

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)

Visual Studio "Pin is required to establish a connection"

I'm getting a weird error from Visual Studio after a fresh install on a clean system.
Today my computer was getting groggy so I decided to reinstall the computer (Win10) this is exactly what I did
1) Backed up using a batch program I wrote which compresses the dragged on directory using 7zip and renames it "folders name( dd/mm # hh:mm)", creates 2 txt files with data for ftp commands, opens an ftp connection to my webserver, uploads the zip, then uploads to same zip to my nas and then to my sd card, the batch deletes the zip from temp and the text files, everything said it performed normally.
2) I went to reset my pc and reset everything and deleted all files
3) After Reinstalling I downloaded 7zip and visual studio with all the addons in the tick box list at the beginning of the installation, except I noticed it has windows phone 10 emulators this time.
4) unzipped my work from the SDHC
5) Opened in VS, VS asked me to login so I did everything loaded in normally
6) Plugged In my phone (Lumia 930 WP10) clicked start debugging
and I got this popup
A PIN is required to establish a connection with the remote device. Please enter the PIN to pair the Device
I have never seen this error, and as far as I can tell no one else has, that's why I have written in detail what I did to get it, the only post I can find says it is in the debugging properties so to set it to no authorisation but that is for a raspberry pi using VS and that option is not there or anywhere within VS
the phone does not have a pin, or can I find a single setting anywhere on the phone or VS.
I did however come across a setting in the phone that allows you to connect to your phone in the browser on a computer via its ip and remotely control the phone and access all the data via the browser
The Error I Get in VS
The Phone Remote from a browser (If anyone is curious)
UPDATE*** no matter what I do, I CAN run any of the windows phone 10 emulators, but VS CANNOT detect any emulators other than 8.1 emulators
Same problem, then I found this answer:
https://stackoverflow.com/a/33667162
The solution is really helpful for me.
Simply, you can do this from an admin command prompt:
reg add HKLM\SYSTEM\CurrentControlSet\Control\SirepClient /v DisableProtocol3 /t REG_DWORD /d 1
PROBLEM SOLVED**
I went to programs & features, clicked visual studio community edition, and clicked repair, after it finished it said there was a problem installing the windows 10 SDK (v XX.XX.XX), so I went to
https://dev.windows.com/en-US/downloads/windows-10-sdk
I noticed the version number on the website to be higher, so I installed the SDK manually using the download link and presto it works :)
I had this issue when running Visual Studio in a virtual machine under both VM Ware Workstation 12 on a windows host, and VMWare Fusion 8 on a MAC host.
The solution was to edit the virtual machine settings and change the USB Compatibility settings from version 3.0 to 2.0.
I made it work with the following steps:
Turn the developer mode off on the phone and switch to "Only install Apps from Store"
Unplug the phone's USB connection
Restart the phone
Restart your PC
Start Visual Studio
Connect the phone to your USB port
Try to debug the app on your phone, if Visual Studio does say anything else than "You have to put the phone into Sideload mode" (or simular), start over with step 1.
Put the phone into sideload mode (not developer mode) and try again to debug, now the same message should show up like in step 7.
Switch your phone into developer mode
Now the deploying process should work without any trouble. If not try the steps (maybe with some variations) again. I don't know where the problem is, but the above steps worked for me. I don't know whether all steps are necessary, report back if you can leave one out. This solution doesn't helps permanently, sometimes the problem comes up again. I think don't unplug the phone while debugging, helps to let the problem occur less often.
You simply need to swipe your phone to unlock it (also enter pin if any). Since the phone is locked you cannot deploy any app on it.

Why am I getting a "package could not be registered" deployment error on Windows 10 UWP?

I have an application targetted for Windows 10 and the UWP. The application correctly runs for x86 and x64 but when I try to run it on a mobile device targetting ARM on a Nokia Lumia 820 I get an error message during deployment:
DEP0001 : Unexpected Error: Package could not be registered. (Exception from HRESULT: 0x80073CF6)
There are other questions relating to this error that suggest it could be an issue with shared user certificates or that you can't have Audio and Device use in the same background task but I am not using either of these. There is also a suggestion that this may be due to a missing icon however to the best of my knowledge I am including far more icons than I actually need.
I have tried removing everything from my assets folder and removing it from the manifest but this also hasn't solved the problem.
Edit I've also tried creating a new blank universal project and that too runs on x86 and x64 but not on the mobile.
You have to run Windows 10 Mobile on your Lumia and you should at least have OS Version 10.0.10240.x. This will work with the release Version of Visual Studio 2015. If you have a CTP or Preview Version of Visual Studio, you should update them to release to get it running.
To get the preview onto the phone, you need the Windows Insider app on your phone and follow the instructions. Choose "fast ring" to get the latest bits.
http://windows.microsoft.com/en-us/windows/preview-download-phone
Get the app here:
https://www.microsoft.com/de-de/store/apps/windows-insider/9wzdncrfjbhk
This should make it work for you.
For more info on the current preview version check this link:
http://blogs.windows.com/bloggingwindows/2015/08/12/announcing-windows-10-mobile-insider-preview-build10512/

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