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?
Related
I am trying to do physical testing for an iOS app using Xamarin Forms following this tutorial: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/deploy-test/hot-restart, but I am running into a problem when trying to debug to an iPhone or iPad. There have been no issues doing physical testing on Android through usb or simulation testing through MacInCloud, but I run into this error when deploying to iOS through usb for testing:
"Xamarin.iOS does not support running or debugging the previous built version of your project. Please ensure your solution builds before running or debugging it."
My Apple Developer Account is successfully linked to Visual Studio and I have iTunes installed, so I don't know what the issue could be relating to. I have tried all the common fixes, such as cleaning and rebuilding the file, restarting visual studio, and trying multiple devices.
I appreciate any help I can get.
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)
I have my xamarin app, when i start it form VS2019 in Release or Debug mode it works great.
If i archive it with visual studio, sign and install to mine or other android phone, it crashes.
APK can't get SQLite table, because i truncated that at start. Logcat helped me understand what the problem is.
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)
Hi I am new to the Android Application world. I have installed the Monodroid plugin for Visual Studio. I created a new Mono for Android Application. The project builds, I start my emulator, I select my emulator in the Select Devices dialog, the dialog then states Copying application to device... the dialog then goes away. However, the application never appears in my emulator. There are no errors the project builds fine, but the app never appears in the emulator. has anyone run into this before?
My guess is the app is starting and crashing quickly. Check the Android Debug Log to see if there are any exceptions or messages there.
http://docs.xamarin.com/android/advanced_topics/android_debug_log