Unable to add Xamarin Facebook SDK package in Xamarin.Forms Droid solution due to dependencies

喜夏-厌秋 提交于 2019-12-11 06:07:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!