我想使用 SlidingPaneLayout 或 DrawerLayout,但这些需要更新的支持库。Xamarin 在组件商店中有一个(Android 支持库 v4(修订版 18)。
但是,如果我尝试使用它并使用 Mvvm Fragments 支持(需要引用 Mono.Android.Support.v4),我会收到如下链接器错误:
error : Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Android.Support.V4.App.FragmentManager/IOnBackStackChangedListenerImplementor, Xamarin.Android.Support.v4-r18, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; Second Type: 'Android.Support.V4.App.FragmentManager/IOnBackStackChangedListenerImplementor, Mono.Android.Support.v4, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'
删除旧的支持库引用会导致不同的链接器错误;
错误 CS0012:类型Android.Support.V4.App.FragmentActivity' is defined in an assembly that is not referenced. Consider adding a reference to assembly
Mono.Android.Support.v4,版本=0.0.0.0,文化=中性,PublicKeyToken=84e04ff9cfb79065'