简体   繁体   中英

Xamarin.Android Conflict between assemblies

I'am facing a ridiculous issue on Xamarin.Android. I'am replacing the basic Actionbar by a Toolbar in my App. I want to support from Android 4.0.4 to newer Android versions. So i installed with Nuget packages (Visual studio) this package:

Xamarin.Android.Support.v7.AppCompat which install this package too: Xamarin.Android.Support.Fragment

Well it's ok but i use this package in order to scan Qrcodes and Barcodes: ZXing.Net.Mobile

Error:

FragmentStatePagerAdapter exists in 'Xamarin.Android.Support.Fragment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

So i decided to remove one of them but ZXing.Net.Mobile use Xamarin.Android.Support.v4 and Xamarin.Android.Support.v7.AppCompat use Xamarin.Android.Support.Fragment .

Is there a solution for this kind of issue ?

Thank you !

Solution:

Install Xamarin.Android.Support.v7.AppCompat 23.4.0.1 and upgrade when Zxing retarget packages. 2.4.0.1 = July 2016 < September 2016 (Package split, explained in first answer)

The answer is that ZXing.Net.Mobile will need to retarget and use the Xamarin.Android.Support.Fragment package as the v4 package has been split into multiple packages:

With this release, the v4 Support Library has been split into several smaller modules:

  • support-compat
  • support-core-utils
  • support-core-ui
  • support-media-compat
  • support-fragment

https://developer.android.com/topic/libraries/support-library/rev-archive.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM