2016-04-22 174 views
5

我无法将GCM添加​​到我的Xamarin应用中。这是来自程序包控制台的输出:无法添加Xamarin Google Play服务

Adding Xamarin.GooglePlayServices.Gcm... 
Attempting to resolve dependency 'Xamarin.GooglePlayServices.Base (= 29.0.0.1)'. 
Attempting to resolve dependency 'Xamarin.GooglePlayServices.Basement (= 29.0.0.1)'. 
Attempting to resolve dependency 'Xamarin.Android.Support.v4 (≥ 23.1.1.1)'. 
Attempting to resolve dependency 'Xamarin.GooglePlayServices.Measurement (= 29.0.0.1)'. 
Updating 'Xamarin.Android.Support.v4 23.0.1.3' to 'Xamarin.Android.Support.v4 23.3.0' failed. Unable to find a version of 'Xamarin.Forms' that is compatible with 'Xamarin.Android.Support.v4 23.3.0'. 

回答

0

您需要更新Xamarin.Forms包。在打开包装解决方案(下拉)窗格,右键单击Xamarin.Forms,点击更新

enter image description here

如果您正在使用PCL,你可以找到这个包在PCL(Xamarin.Forms)项目。

如果您使用Shared Asset Project,您将在Xamarin.Android和Xamarin.iOS项目中找到该软件包。

+1

这没有奏效。必须有一些循环问题阻止软件包更新正常工作。最后,我不得不移除Xamarin Forms,然后在软件包上运行更新以获得更新版本的MediaRouter,然后添加Xamarin Forms。 – MarkB

+0

我删除了所有包,然后重新添加Xamarin表单。然后尝试添加GCM。这是我相信Xamarin必须解决的版本冲突。请在此查看日志: https://www.dropbox.com/s/kifib3u3ortk6zm/package.log – MarkB

3

对于此版本,您必须安装较早版本的Xamarin.GooglePlayServices.Gcm。我对27.0.0没有任何问题。

如果你需要最新的版本,你可以这样做:

  • 卸载xamarin.forms NuGet包
  • 更新所有Android软件包23.3.0
  • 安装Xamarin.GooglePlayServices.Gcm
  • 搜索xamarin.forms并设置选项ignore dependencies
  • 安装最新版本

当然,您必须意识到问题,因为不建议有充分的理由。

0

您必须将Android SDK Platform-tools更新为修订版26.0.2(或同等版本)。

打开Android SDK管理器,检查更新,并选择

“更新缴费rev.26.0.2” 并安装它。

enter image description here

相关问题