rynm
rynm

Reputation: 55

Cannot install some packages on Xamarin Forms project (netstandard2.0)

I am trying to add some packages and I am getting the same error all the time. Below is the error when installing Google Ads:

Package Xamarin.GooglePlayServices.Ads.Lite 60.1142.1 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package Xamarin.GooglePlayServices.Ads.Lite 60.1142.1 supports: monoandroid80 (MonoAndroid,Version=v8.0)

I am getting the same if I try to install Compat packages.

Can anybody give me some advice as I have been changing some parameters and trying to install other versions of the packages (which should work) but I am getting alway the same problem.

Should that package (google ads) be installed only in the Android project or in the main project as well?

Upvotes: 2

Views: 4324

Answers (3)

Ljupcho Hristov
Ljupcho Hristov

Reputation: 275

This worked for me:

  1. Remove any "Xamarin.GooglePlayServices.*" packages.
  2. Clean solution
  3. Add latest "Xamarin.GooglePlayServices" package
  4. Restart VS
  5. Clean Solution
  6. Rebuild
  7. Run

Upvotes: 1

Woj
Woj

Reputation: 833

Package Xamarin.GooglePlayServices

Is designed only for Android projects. Don't add it to your PCL or iOS project. Only add it to your Android Project.

Upvotes: 9

Dmitry Zinoviev
Dmitry Zinoviev

Reputation: 588

It is android platform specific lib, so it must be only in Droid project

Upvotes: 3

Related Questions