MarkB
MarkB

Reputation: 51

Unable to add Xamarin Google Play Services

I'm unable to add GCM to my Xamarin app. This is the output from the package console:

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'.

Upvotes: 5

Views: 1945

Answers (3)

StefanoM5
StefanoM5

Reputation: 1337

You have to update Android SDK Platform-tools to revision 26.0.2 (or equivalent).

Open Android SDK Manager, check update, and select

"Update avaiable rev.26.0.2" and install it.

enter image description here

Upvotes: 0

Matt
Matt

Reputation: 4607

For this version you must install an earlier version of Xamarin.GooglePlayServices.Gcm. I had no problems with 27.0.0.

If you need the newest version, you could do this:

  • uninstall xamarin.forms nuget package
  • update all android packages to 23.3.0
  • install Xamarin.GooglePlayServices.Gcm
  • search for xamarin.forms and set in options ignore dependencies
  • install newest version

Of course you must be aware of problems, since this is not recommended with good reasons.

Upvotes: 3

Sreeraj
Sreeraj

Reputation: 2434

You need to Update your Xamarin.Forms package. Open Packages (Dropdown) in Solutions pane and Right-Click on Xamarin.Forms and click on Update

enter image description here

If you are using PCL, you can find this package in the PCL (Xamarin.Forms) project.

If you are using Shared Asset Project, you will find this package in both Xamarin.Android and Xamarin.iOS project.

Upvotes: 0

Related Questions