Installing GooglePlayServices using NuGet gives me Install-Package error

So, I am trying to install this package in my solution, and I got a strange error. I can not fix or find a solution for.

Installation error. Rollback ... Install-Package: Failed to install the package "Xamarin.Android.Support.v7.AppCompat 21.0.3.0". You are trying to install this package in a project that targets “MonoAndroid, Version = v2.2,” but the age package does not contain assembly references or content files that are compatible with this structure. For more information, contact the author of the package. On line: 1 char: 16 + Install-Package <<<Xamarin.GooglePlayServices + CategoryInfo: NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId: NuGetCmdletUnhandledException, NuGet.PowerShell.Commandsage.mandallPack

I tried changing my version of MonoAndroid to the latest or earliest, and it didn't seem to change anything, so I returned it to where it was originally.

This is the error I am getting. The problem is that I either need to get this to work (because Xamarin did not update my site, so I can’t download it and just take them .dll) OR make the bindings for Google Play Services myself, which would probably be a pain in ass.

If there is no other way? Thanks in advance!

+6
source share
3 answers

Looking at the Xamarin.Android.Support.v7.AppCompat 21.0.3.0 NuGet package, it contains only the build for MonoAndroid 4.0.3, so your project will need to target this version or higher before you can install it.

It looks like you are using Visual Studio so that you can either enter the project settings or change the target version of Android in the project properties and change Compile using the Android version or edit the project file (.csproj) and change TargetFrameworkVersion directly in the file.

<TargetFrameworkVersion>v4.3</TargetFrameworkVersion> 

If you need to target Android 2.2, you can use the Xamarin.GooglePlayServicesFroyo NuGet package, as it can be installed in a project targeted at MonoAndroid 2.2

+4
source

The following settings work for me:

enter image description here

+5
source

Following this answer , all you have to do is change this: enter image description here

:

enter image description here

+2
source

Source: https://habr.com/ru/post/982447/


All Articles