问题
I'm struggling adding the Facebook Android package (tried both with Nuget and component manager) to the Droid solution on my Xamarin.Forms project.
It seems there's some kind of incompatibility between the package Xamarin.Forms and its dependencies and Facebook SDK package dependencies. If I remove the package Xamarin Forms (and all its dependencies), the Facebook Android SDK package installs OK (with dependencies), but I can't add Forms after adding Facebook SDK because of dependencies issues.
It seems that Xamarin.Forms 2.3.2.127 installs Xamarin.Android.Support.xxx with version 23.3.0 only (unable to update from 23.3.0), but the FB SDK needs a newer version.
Here is what Xamarin.Studio outputs:
Attempting to gather dependency information for package 'Xamarin.Facebook.Android.4.16.1' with respect to project 'MyApp.Droid', targeting 'MonoAndroid,Version=v7.0' Attempting to resolve dependencies for package 'Xamarin.Facebook.Android.4.16.1' with DependencyBehavior 'Lowest' Unable to find a version of 'Xamarin.Android.Support.v4' that is compatible with 'Xamarin.Android.Support.Design 23.3.0 constraint: Xamarin.Android.Support.v4 (= 23.3.0)', 'Xamarin.Android.Support.v7.AppCompat 23.3.0 constraint: Xamarin.Android.Support.v4 (= 23.3.0)', 'Xamarin.Android.Support.v7.MediaRouter 23.3.0 constraint: Xamarin.Android.Support.v4 (= 23.3.0)', 'Xamarin.Android.Support.v7.RecyclerView 23.3.0 constraint: Xamarin.Android.Support.v4 (= 23.3.0)', 'Xamarin.Facebook.Android 4.16.1 constraint: Xamarin.Android.Support.v4 (>= 23.4.0.1)', 'Xamarin.Forms 2.3.2.127 constraint: Xamarin.Android.Support.v4 (= 23.3.0)'.
Am I the only one facing this issue? Is there anyone who could help me please?
Ejoe
回答1:
You’ll need install the version of Xamarin.Facebook.Android that is compatible with the version of Xamarin.Forms being used. Note the differences below:
Xamarin.Forms v2.3.2.127
Dependencies MonoAndroid 1.0
- Xamarin.Android.Support.v4 (= 23.3.0)
- Xamarin.Android.Support.Design (= 23.3.0)
- Xamarin.Android.Support.v7.AppCompat (= 23.3.0)
- Xamarin.Android.Support.v7.CardView (= 23.3.0)
- Xamarin.Android.Support.v7.MediaRouter (= 23.3.0)
Xamarin.Facebook.Android v4.16.1
Dependencies MonoAndroid 4.0.3
- Xamarin.Android.Support.v4 (>= 23.4.0.1)
- Xamarin.Android.Support.v7.CardView (>= 23.4.0.1)
- Xamarin.Android.Support.v7.AppCompat (>= 23.4.0.1)
- Xamarin.Android.Support.CustomTabs (>= 23.4.0.1) Bolts (>= 1.4.0.1)
Here is a related Xamarin.Forms troubleshooting guide and similar dependency issue.
来源:https://stackoverflow.com/questions/40384594/unable-to-add-xamarin-facebook-sdk-package-in-xamarin-forms-droid-solution-due-t