无法安装包Xamarin.Firebase.Messaging

时间:2018-05-02 11:48:25

标签: firebase xamarin xamarin.forms xamarin.android

我正在尝试在我的Xamarin的Xamarin.Android项目中安装最新版本的 Xamarin.Firebase.Messaging (截至今天: 60.1142.1 ) .Forms解决方案。

我收到此错误:

Attempting to gather dependency information for package 'Xamarin.Firebase.Messaging.60.1142.1' with respect to project 'prova.Droid', targeting 'MonoAndroid,Version=v7.1'
GET https://api.nuget.org/v3/registration3-gz-semver2/xamarin.firebase.messaging/index.json
OK https://api.nuget.org/v3/registration3-gz-semver2/xamarin.firebase.messaging/index.json 137ms
Total number of results gathered : 20
Gathering dependency information took 157,61 ms
Summary of time taken to gather dependencies per source :
https://api.nuget.org/v3/index.json -   156,72 ms
Attempting to resolve dependencies for package 'Xamarin.Firebase.Messaging.60.1142.1' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Xamarin.Firebase.Messaging.60.1142.1'
Resolved actions to install package 'Xamarin.Firebase.Messaging.60.1142.1'
Retrieving package 'Xamarin.Firebase.Messaging 60.1142.1' from 'nuget.org'.
GET https://api.nuget.org/v3-flatcontainer/xamarin.firebase.messaging/60.1142.1/xamarin.firebase.messaging.60.1142.1.nupkg
OK https://api.nuget.org/v3-flatcontainer/xamarin.firebase.messaging/60.1142.1/xamarin.firebase.messaging.60.1142.1.nupkg 540ms
Acquiring lock for the installation of Xamarin.Firebase.Messaging 60.1142.1
Acquired lock for the installation of Xamarin.Firebase.Messaging 60.1142.1
Installing Xamarin.Firebase.Messaging 60.1142.1.
Completed installation of Xamarin.Firebase.Messaging 60.1142.1
For adding package 'Xamarin.Firebase.Messaging.60.1142.1' to project 'prova.Droid' that targets 'monoandroid71'.
Install failed. Rolling back...
Package 'Xamarin.Firebase.Messaging.60.1142.1' does not exist in project 'prova.Droid'
Package 'Xamarin.Firebase.Messaging.60.1142.1' does not exist in folder '/Users/g.paradiso/Projects/prova/packages'
Executing nuget actions took 592,47 ms
Could not install package 'Xamarin.Firebase.Messaging 60.1142.1'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

我正在关注this指南,它说您需要使用版本 57.1104.0-beta1 并且它有效,但为什么我不能使用最新版本?< / p>

1 个答案:

答案 0 :(得分:2)

  

无法安装软件包'Xamarin.Firebase.Messaging 60.1142.1'。您   正在尝试将此软件包安装到目标项目中   'MonoAndroid,版本= v7.1',但包中不包含任何内容   程序集引用或与之兼容的内容文件   框架。

简而言之,这意味着兼容性问题,如果需要,请阅读几次,直到获得它为止。

为了解决这个问题,请检查'Xamarin.Firebase.Messaging 60.1142.1'的依赖关系。 NuGet包here。当您拥有MonoAndroid 8.0时,它会明确指出MonoAndroid 7.1

因此,您可以使用较早版本的Xamarin.Firebase.Messaging(不推荐),也可以将Android项目中的目标框架更新为8.0。