Quick Links

Xamarin.Forms app crashes in release mode on iOS device

We have a major project that we have been releasing iterative Ad Hoc builds to our client for months now without problem. Now, since our last build (and at least one or two IDE updates later), we can no longer do a release build of any kind without it crashing immediately upon launching the app (doesn't make it past the splash screen). Here's a breakdown of what happens:

We have tried almost every build variant imaginable at this point, but it was working fine with the configuration we had up until recently. We tried checking out previous tags from builds we know worked before but to no avail. This tells me it's an environment/IDE problem.

Here is a symbolicated crash log from our iPad running iOS 10.3.1: https://pastebin.com/Xr3uq6wH. One of the lines was unable to symbolicate (even manually with atos) for whatever reason, but I don't think it makes a difference, as it appears to be framework-level.

Answers

That crash report is not revealing anything to me. Sometimes the iOS Device logs give the best error message in situations like this. Check them in real time as you launch the app to device in release mode.

Device console logs

Visual Studio (Windows):
1. Use the View->Other Windows->Device Log menu to launch the Device Log pane.
2. Choose the device in the Choose Device drop down list at the top of the pane.

Xamarin/Visual Studio (Mac):
1. Use the View->Pads->Device Log menu to launch the Device Log pane.
2. Choose the device in the Choose Device drop down list at the top of the pane.

XCode:
1. Open Xcode with your device attached to your Mac.
2. Click the Window->Devices menu to open the Devices window.
3. Select your device from the list on the left and then click the small up arrow button on the lower left of the main pane. This will open the live console logs for the device.

Hi,
I am getting witless here...
Having the exact same symptoms but a simple clean and rebuild doesn't solve it!!
It seems that its from the last Visual Studio Mac update and basically the problem is that whatever plugin I try to instantiate in AppDelegate -> FinishedLaunching it throws this:

Now it talks about the MR.Gestures plugin, but if I want to initialize something else before then its that, so its for sure its not whatever plugin that is the problem.
Also I already have published the app on the app store and in multiple TestFlight versions that work.
Its just started to happen without any major modification if its not the latest Visual Studio Mac update with Mono update and all...

Debug works as expected on the same device.
I wanted to reinstall the NugetPackages but with the Visual Studio update the Nuget console doesn't work anymore... It seems that I will need to do it by hand..

I have no idea why the order of initializing plugins would cause the exception only in a release build. I would suspect some linker issue. Can you still recreate the issue? If so can you tell me what plugins are involved and the order you are initializing them to get the exception in Release? If you can get back to the state where it is failing in release, can you set the iOS Project Options -> iOS BUIld -> Linker Behavior to "Don't Link"? Also what was that Linker Behavior set to before you found the cause? If you were using the "Link All" setting, then all bets are off (IOW you would have to add some Linker properties to preserve any namespaces/types/members that may have been stripped away by the Linker). If you were using "Link Framework SDKs Only" then we likely need get a bug report filed.