Reputation: 2698
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.
Upvotes: 3
Views: 6806
Reputation: 74134
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
Upvotes: 1