Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Steps to reproduce:
1) Create new XM Modern App
2) Add a reference to a nuget using Xamarin.Mac. Xamarin.Forms.188.8.131.526-pre6 for example)
3) Swap to i386
4) Build and run
Native type size mismatch between Xamarin.Mac.dll and the executing architecture. Xamarin.Mac.dll was built for 64-bit, while the current process is 32-bit.
at <unknown> <0xffffffff>
at (wrapper managed-to-native) object.wrapper_native_0xa2770 () <0x00012>
at ObjCRuntime.Runtime.EnsureInitialized () [0x0004a] in /Users/donblas/Programming/macios/cycle9/xamarin-macios/src/ObjCRuntime/Runtime.mac.cs:118
at AppKit.NSApplication.Init () [0x00017] in /Users/donblas/Programming/macios/cycle9/xamarin-macios/src/AppKit/NSApplication.cs:56
at Mobile32.MainClass.Main (string) [0x00001] in /Users/donblas/Projects/Mobile32/Main.cs:9
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) [0x00051] in <2076c811a8514765bf1d226d27b7acb5>:0
This is because we first call SwapOutReferenceAssembly in driver.cs with the reference, not file name, don't swap it out. And then later do.
This is likely always been broken, but since we fall back to the "reference", which is x86_64, we never noticed. i386 is not common.
This is fixed in master and will be released in the 15.5 release.
Until then the simplest work around would be to use a post-build target (https://github.com/xamarin/mac-samples/tree/master/UseMSBuildToCopyFilesToBundleExample) to a 32-bit Xamarin.Mac from
into your final bundle. In this application, it would be the Full, since it is using the Full (Not Mobile/Modern) version.