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.
I was directed by one of the Xamarin.iOS team members to post this issue here.
Native code sharing is not working on my Xamarin Forms App + iOS Extensions.
See full output here:
In particular, I see this line happening:
Native code sharing has been disabled for the extension 'BitwardeniOSExtension' because the container app is referencing the assembly 'Google.Analytics' from '.../mobile/src/iOS/obj/iPhone/AppStore/XbdMerge/Google.Analytics.dll', while the extension references it from '.../mobile/src/iOS.Extension/obj/iPhone/AppStore/XbdMerge/Google.Analytics.dll'.
Full code repo to reproduce the issue can be found here: https://github.com/bitwarden/mobile
According to the log, Google.Analytics.dll is passed from multiple locations to mtouch:
which is strange.
To be complete, I was having similar errors with Xamarin.Forms and some other packages whenever they existed in the host app projec, but not the Extension project. Whenever I referenced them in both projects from NuGet, those errors went away. Example:
warning MT0113: Native code sharing has been disabled for the extension 'BitwardeniOSExtension' because the container app is referencing the assembly 'Xamarin.Forms.Core' from '/Users/kyle/Projects/bitwarden/mobile/packages/Xamarin.Forms.18.104.22.168/lib/Xamarin.iOS10/Xamarin.Forms.Core.dll', while the extension references it from '/Users/kyle/Projects/bitwarden/mobile/src/App/bin/Release/Xamarin.Forms.Core.dll'.
Not sure if this has anything to do with it, but the Xamarin Google Analytics package for iOS has a dependency on Xamarin.Build.Download. Not really sure what that package does, but something involved with the build that may be screwing with things?
The "XdbMerge" is comes from here: https://github.com/xamarin/XamarinComponents/blob/8dc883172c4006423be47b3cb437e1952981d030/Util/Xamarin.Build.Download/source/Xamarin.Build.Download/BaseXamarinBuildResourceRestore.cs#L41
If I'm reading this  right, the idea is for Xamarin.Build.Download to rewrite the assembly, and change the old reference. For some reason it seems like the old reference isn't removed.
I'm re-assigning to the Components team: please bounce back if my diagnosis is incorrect.
@Kyle, I've filed a different bug to allow code sharing for identical assemblies, even if paths are different: bug 56513. That should also fix your problem, even if this bug isn't fixed.
I have changed Xamarin Build Download to write the dll back to the source location.
This will ensure that the build is only considering one dll.
You will need to update Xamarin.Build.Downoad to 0.4.5.
*** Bug 56837 has been marked as a duplicate of this bug. ***
Unfortunately, I have the same warning. However, I have the latest xamarin version installed and Xamarin.Build.Download 0.4.9
The warning looks as follows:
Users/ilya/Projects/Abc/Abc.xamarin/Abc.iOS.ShareExtension/bin/iPhone/Debug/Realm.dll'. (MT0113) (Abc.iOS)/Users/ilya.khorev/Projects/Abc/Abc.xamarin/Abc.iOS/MTOUCH: Warning MT0113: Native code sharing has been disabled for the extension 'AbciOSShareExtension' because the container app is referencing the assembly 'Realm' from '/Users/ilya.khorev/Projects/Abc/Abc.xamarin/Abc.iOS/bin/iPhone/Debug/Realm.dll', while the extension references a different version from '/Users/ilya.khorev/Projects/Abc/Abc.xamarin/Abc.iOS.ShareExtension/bin/iPhone/Debug/Realm.dll'. (MT0113) (Abc.iOS)
I've already tried to clear Xamarin cache and removed all bin, obj folder, nothing helped. Any ideas how to overcome this irritating issue?
@Ilya, please post this on GitHub (https://github.com/xamarin/xamarin-macios/issues/new) and include the complete build log.