Unfortunately "app_name" has stopped in xamarin forms - xamarin.android

After upgrading to Xamarin 4.3.0.784, my app is crashing every time. And I am getting notification "one or more errors occurred" in Xamarin.Android.common.Debugging.Targets file under GetPrimaryCpuAbi tag.

I did some research about this issue on few days ago, I can give you some tips on the following:
1-try to disable Fast Deployment in android build options(Release Mode).
2-try to disable Shared Shared Runtime in android build options(Release Mode).
3-actually you did not need to enable all architectures check-boxes under Supported architectures.
and if you want to Deal with Startup Crashes, check the following link:
https://developer.xamarin.com/guides/insights/platform-features/advanced-topics/dealing-with-startup-crashes/
and to avoid Xamarin.forms app crashes for unknown reason, try to get latest stable version of Xamarin.forms package from nuget.org.

Finally I found the solution. I opened the project with visual studio, disabled "Use shared runtime", enabled all supported architectures. After restarting, now it is working.

Related

Xamarin iOS - Archive for Publishing: Could not resolve reference Mono.Android

I've been developing a Xamarin app for both Android and iOS, and after publishing to Google Play now would like to launch on the Apple App Store as well. I have installed Visual Studio 2019 on a Mac, and can successfully test a release version of the app on a simulated device. Now, following this guide on publishing to the App Store I need to create an archive for publishing. However, when doing so I get the lovely error:
Could not resolve reference. Could not locate the assembly "Mono.Android". Check to make sure the assembly exists on dirk. If this reference is required by your code you may get compilation errors.
I never reference Mono.Android directly in my code, and there are also no compilation errors when building and executing the Xamarin.iOS project. There are also several versions of the Mono.Android.dll on disk, located at /Library/Frameworks/Xamarin.Android.framework/Versions/11.0.2.0/lib/xbuild-frameworks/MonoAndroid/[version]/Mono.Android.dll
How do I resolve this?

Issue with using On-Demand Resource through Xamarin.iOS on iOS simulator

I have run into an issue where I am unable to access assets tagged for use in Apple’s On-Demand Resource feature through a Xamarin.iOS app, but only when run on the simulator. This only occurred after updating my environment. I was previously on Visual Studio for Mac version 8.3.9 and Xcode version 11.2.1, and my app was able to access ODR resources without issue on both simulator and physical device.
Now I am on Visual Studio version 8.4.2 and Xcode version 11.3.1, and my app is not functioning correctly. However, I am only seeing issues when running on an iOS simulator (for any iOS version). I can build and run on a physical device (running iOS version 13.0)and am seeing no problems.
I am creating and tagging an asset for use in Apple ODR through Visual Studio for Mac. I have a ZIP file that I add into my app’s iOS project directly as a resource. In its properties, I set the BuildAction as BundleResource, select “Do Not Copy” to output directory, and give it an On-Demand Resource tag.
When I build my solution, I can see this ZIP file nested in a *.assetpack directory under bin/iPhone/Debug/device-builds/iphone12.3-13.0/OnDemandResources. I believe it is supposed to be put in bin/iPhone/Debug/OnDemandResources/ instead. When I run the code that calls NSBundleResourceRequest’s BeginAccessingResourcesAsync, it seemingly does nothing. I see the following error message in the Application Output debug window in VS after that function is called:
Begin: Request 0x0x600002566100 response: Error: Error Domain=NSCocoaErrorDomain Code=4994 "The requested application data doesn’t exist." UserInfo={NSLocalizedFailureReason=InvalidTag}
There’s no other error or exception being thrown. When I try to get the resource path from the NSBundleResourceRequest.Bundle object, it expectedly returns null.
Any reason why this is happening, and why this is only occurring on the iOS simulator and not on a physical device? I haven’t been able to find anything useful when searching for the above error message. Did something change in Visual Studio regarding how bundled assets are built in Debug mode?
Not really an answer, but more of a workaround. Using version 8.3.9 of VS for Mac seems to not throw this error, so I reverted back to that version

Deploying Xamarin.Forms app to iOS: MT1006 EOF Error (error: 0xe800000e)

I am trying to run a Xamarin.Forms app on my iPad and getting the following error:
Launch failed. The app 'AppIOS' could not be launched on 'My iPad'. Error: error MT1006: Could not install the application '/Users/mycompany/Library/Caches/Xamarin/mtbs/builds/AppIOS/someguid/bin/iPhone/Debug/my.app' on the device 'My iPad': EOF Error (error: 0xe800000e).. Please check the logs for more details.
This app has previously ran fine on the same device. The iOS build and deployment process seems very unstable so it often takes multiple attempts so I'm used to having to restart Visual Studio, the Mac it builds on and the iPad and generally wasting a whole lot of time. I have restarted everything involved here multiple times but this error persists. I have checked the device logs and there are no related messages or even any messages at the appropriate times.
I'm using Visual Studio 2017 (15.9.4), Xamarin.iOS and Xamarin.Mac SDK (12.2.1.12), building on a Mac Mini running macOS Mojave and XCode 10.1, deploying to an iPad Air (A1474) running iOS 12.1.1. As far as I'm aware there have been no updates to any of these since I last had it working. The UWP version of the app runs fine.
I can find a lot of MT1006 issues but none with EOF Error (error: 0xe800000e) and I can find no information about this specific error at all. Can anyone enlighten me on what this means?
Sounds overly simple, but I just had this issue and I solved it by restarting the iOS device and redeploying it. Specifically, I was deploying to an iPod 6th Gen and I held the power and home buttons until the screen turned black, this is more of a hard restart. Then let the device reboot and try deploying again.
NOTE: Don't hold the power and home buttons too long, because if you do, the iPod will go into a factory reset restart.
Try pulling up the device in Xcodes' devices tab. I did and realized the device had an error within the tab. I then disabled the "Connect via network" button, then things started to work properly.
I am agree, Xamarin build environment on iOS part is very buggy.
In any case of unknown error in such config: VS<->MAC<->iOS Device try these steps:
Try to switch Off and On Mac wifi.
Reconnect VS to Macbook and Macbook to IPhone.
Delete bin and obj folders on Macbook
Check your PList and Entitlements file(as example wrong aps-environment setting can cause installing errors)
Check your sign project settings
5a. Check your provisoning profile term
unistall application from ios
rebuild and run project again
I'll appent new lines in case i'll remember something else.
What you described happened to me and solved by 1,2,7

Error debugging the IOS Extensions in Visual Studios Xamarin

The issue I am having is that I can't debug the share extension. I've tried setting break points in the share extension and they are never hit. If I attempt to debug the main app, all works as expected.
This is what I've done. Any help is appreciated!
I tried setting the share extension project as the startup project and I've tried setting multiple projects as startup and then when I run I get the following error:
In the IDE..."Launching Share Extension" and then after a few minutes the error "App has terminated"
Has anyone been successful at debugging an IOS extension using visual studios Xamarin?
As mentioned by SushiHangover, debugging iOS extensions in Visual Studio is available in 4.3.0.550 (RC) and introduced in 4.3.0.405.
As of this writing, 4.3.0.550 is available through the beta channel.
As a note, make sure that your Mac Build Agent is running on the same version.

Xamarin iOS debugger not hitting breakpoints

Yesterday morning as I started working on a Xamarin iOS application when my debugger stopped working. I can place breakpoints but as soon as the application starts the breakpoints become hollow like a red donut. I've rebuilt/cleaned project multiple times, I've also wiped obj/bin folders and nothing seems to work. I can't hit breakpoints.
This doesn't happen to all my classes, it looks like it applies to classes where an async function is used however this isn't always the case.
I also get a message in my debugger window which may have only started showing since this bug.
Xamarin.iOS: Successfully received USB connection from the IDE on port 10000, fd: 7
Xamarin.iOS: Processing: 'start profiler: no'
Xamarin.iOS: Profiler not loaded (disabled)
I'm using Xamarin Studio 6.0.1 Build 9 Indie
I have found solution related to this issue: https://stackoverflow.com/a/34211506/4627978.
Also be sure, that you set Debug configuration in Xamarin Studio (not Release, AppStore, etc.) and enable debugging in Project Options > Build > iOS Debug > Enable debugging
After all this don't forget Clean/Rebuild.
I had this same problem and I got it working after changing the iOS project property Linker Behavior to Don't Link.
Make sure you have the iOS SDK updated to what you have in Xamarin.
Here you go with the solution for Visual Studio:
Right-click your project -> Properties
iOS Debug
Enable debugging (and perhaps also Debugging over WiFi)

Resources