所以我有一个跨平台
项目(IOS和Android
),我需要安装GooglePlayServices.Base
NuGet
我的 Android
项目的包,但在尝试时出现此错误:
Package restore failed. Rolling back package changes for 'MyApp.Android'.
我知道是版本不兼容的错误,但是我想不通具体是哪里。
这里是项目所有组件的版本:
Xamarin.Forms
2.5.1.317207-pre1
。项目属性 > 应用程序 > 使用 android 版本编译:
Android 8.0 (Oreo)
。Xamarin.GooglePlayServices.Base
v60.1142.0
(需要安装)。
有些人说只有 GooglePlayServices.Base 32.940.0-beta3
适用于 Xamarin.Forms,但这个对我也不起作用。
有什么想法吗?!
更新:
我可以安装 Xamarin.GooglePlayServices.Base v42.1021.1
但我需要在我的代码中使用 GcmClient
而这个又需要 v60.1142.0
.
最佳答案
仅供将来引用,以防其他人遇到此问题,如果您查看 nuget 包管理器控制台输出,您实际上可以在那里看到解决方案。在我的例子中,错误信息是:
Version conflict detected for Xamarin.GooglePlayServices.Basement. Install/reference Xamarin.GooglePlayServices.Basement 60.1142.1 directly to project LoyaltyWorx.Android to resolve this issue.
LoyaltyWorx.Android -> Xamarin.GooglePlayServices.Base 60.1142.1 -> Xamarin.GooglePlayServices.Basement (= 60.1142.1)
LoyaltyWorx.Android -> LoyaltyWorx -> Plugin.PushNotification 1.3.0 -> Xamarin.Firebase.Messaging 60.1142.0 -> Xamarin.GooglePlayServices.Basement (= 60.1142.0).
因此,我继续安装 Xamarin.GooglePlayServices.Basement 60.1142.1
关于android - 无法为 Xamarin.Forms 项目安装 GooglePlayServices.Base 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49149842/