缺少 xamarin.googleplayservices 引用 [英] missing xamarin.googleplayservices references
问题描述
我正在尝试在我的 xamarin 表单应用程序上使用谷歌地图.我安装了 Google.forms.maps.通过该安装,我得到了以下软件包:
<package id="Xamarin.GooglePlayServices.Base" version="42.1021.1" targetFramework="monoandroid71"/><package id="Xamarin.GooglePlayServices.Basement" version="42.1021.1" targetFramework="monoandroid71"/><package id="Xamarin.GooglePlayServices.Maps" version="42.1021.1" targetFramework="monoandroid71"/><package id="Xamarin.GooglePlayServices.Tasks" version="42.1021.1" targetFramework="monoandroid71"/>
一旦我开始运行应用程序,这些 dll 就会从 android 项目引用中消失,并且我收到错误
Severity Code 描述 Project File Line Suppression State错误 未找到匹配 RestoreAssemblyResources AssemblyName 元数据 'Xamarin.GooglePlayServices.Tasks' app1.Android 的引用未找到与 RestoreAssemblyResources AssemblyName 元数据 'Xamarin.GooglePlayServices.Base' app1.Android 匹配的参考未找到匹配 RestoreAssemblyResources AssemblyName 元数据 'Xamarin.GooglePlayServices.Maps' app1.Android 的参考未找到匹配 RestoreAssemblyResources AssemblyName 元数据 'Xamarin.GooglePlayServices.Basemant' app1.Android 的参考
我在谷歌上搜索了这个错误并尝试使用 nuget 分别添加这些包,所以我这样做了
Install-Package Xamarin.GooglePlayServices.Base -Version 60.1142.0
我收到一条错误消息
Install-Package:无法安装包Xamarin.GooglePlayServices.Base 60.1142.0".您正在尝试将此包安装到以MonoAndroid,Version=v7.1"为目标的项目中,但该包不包含任何
与该框架兼容的程序集引用或内容文件.如需更多信息,请联系软件包作者.
所以我尝试这样做:
Install-Package Xamarin.GooglePlayServices.Base -Version 29.0.0.1
我遇到了与 nuget 包版本 60.1142.0 相同的错误
我使用的是 Visual Studio 2017 企业版.
在这方面的任何帮助将不胜感激.以下是android项目的目标:
我的目标框架是这样的:
而sdk图片是这样的:
下面是visual studio的帮助->关于窗口.
通用信息:
<块引用>无法安装包Xamarin.XXXXXXX".您正在尝试将此软件包安装到以MonoAndroid,Version=vX.X"为目标的项目中
具体信息:
<块引用>无法安装包Xamarin.GooglePlayServices.Base 60.1142.0".您正在尝试将此软件包安装到以MonoAndroid,Version=v7.1"为目标的项目中
将您的 Xamarin.Android
项目更改为至少面向 MonoAndroid 8.0
,因为 Xamarin.GooglePlayServices.Base
v60.1142.0 依赖于 8.0
Nuget:
I am trying to use google maps on my xamarin forms application. I installed Google.forms.maps. With that installation, I got below packages:
<package id="Xamarin.GooglePlayServices.Base" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Basement" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Maps" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Tasks" version="42.1021.1" targetFramework="monoandroid71" />
As soon as I start running the application, these dll's go away from android project reference and I get the error
Severity Code Description Project File Line Suppression State
Error Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Tasks' app1.Android
Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Base' app1.Android
Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Maps' app1.Android
Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Basemant' app1.Android
I googled for this error and tried to add these packages separately using nuget so I did this
Install-Package Xamarin.GooglePlayServices.Base -Version 60.1142.0
I got an error saying
Install-Package : Could not install package 'Xamarin.GooglePlayServices.Base 60.1142.0'. 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.
so I tried doing this:
Install-Package Xamarin.GooglePlayServices.Base -Version 29.0.0.1
I got the same error as I got with nuget package version 60.1142.0
I am using Visual studio 2017 enterprise version.
any help in this regards will be appreciated. Below are the target for android project:
My target framework is like this:
and The sdk Picture is like this:
Below is the visual studio Help-> about window.
Generic message:
Could not install package 'Xamarin.XXXXXXX'. You are trying to install this package into a project that targets 'MonoAndroid,Version=vX.X'
Specific message:
Could not install package 'Xamarin.GooglePlayServices.Base 60.1142.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.1'
Change your Xamarin.Android
project to target at least MonoAndroid 8.0
as Xamarin.GooglePlayServices.Base
v60.1142.0 has a dependency on 8.0
Nuget: Xamarin.GooglePlayServices.Base/60.1142.0
Dependencies
这篇关于缺少 xamarin.googleplayservices 引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!