Skip to content Skip to sidebar Skip to footer

Mvvmcross - Trying To Use Fragments And Latest Support Lib Results In Linking Problems

I'd like to use the SlidingPaneLayout or DrawerLayout, but these require a newer support library. Xamarin has one in the component store (Android Support Library v4 (Rev 18). But i

Solution 1:

I believe this is a general problem caused by Xamarin rebranding an assembly from 'Mono' to 'Xamarin'.

Third party assemblies like MvvmCross and others like the Google Play services component currently link against the 'Mono'-named assembly which ships with Xamarin.Android (formerly Mono for Android).

Currently, MvvmCross can't change it's linking to the 'Xamarin' named assembly without removing support for Maps v2 via the Google Play component - and we have more users currently demanding support for maps then demanding support for the navigation drawer in the latest support library.


If anyone needs to link against the 'Xamarin'-named assembly, then you need some way to redirect assemblies to work with the changed name. Ways I know of doing this are:

  • In full .Net I believe you can do this using 'binding redirects' in an app.config file, but I don't think these are available in Xamarin.Android.
  • You might instead be able to do the redirects using a dummy 'Mono.Android.Support.v4' assembly which contains only [TypeForwardedTo] declarations of types - generating this would be a bit tedious but should work. I tried to generate a TypeForwardTo assembly - https://gist.github.com/slodge/6790040 - but I think the fact that Xamarin have used assembly strong naming means I can't get this to work :/ Xamarin might be able to though?
  • You could fork and rebuild the existing MvvmCross 'Fragging' assembly - it's not large - so that it references the 'Xamarin'-named component. You would also need to do this for any other assemblies you need - e.g. the Google Play one for maps.

Post a Comment for "Mvvmcross - Trying To Use Fragments And Latest Support Lib Results In Linking Problems"