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

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.
Visual Studio for Mac 7.5.2
Project Target Framework: .NET Standard 2.0
Android Target Framework: Android 8.1 (Oreo)
Android Manifest sdks: android:minSdkVersion="19" android:targetSdkVersion="27"
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?

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.

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

This worked for me:
Remove any "Xamarin.GooglePlayServices.*" packages.
Clean solution
Add latest "Xamarin.GooglePlayServices" package
Restart VS
Clean Solution
Rebuild
Run

Related

Rider unable to restore dotnet core packages on mac

I get the following error when I try to restore a dotnetcore project on my mac in Rider.
The sad thing is this error only comes in Jetbrains Rider. I can run my project from the command line and Visual Studio. Any ideas?
[NU1202] Package Serilog.Extensions.Hosting 4.0.0-dev-00051 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Serilog.Extensions.Hosting 4.0.0-dev-00051 supports: netstandard2.1 (.NETStandard,Version=v2.1)
I was running an older version of Rider. After upgrading to the newest version, it worked fine.

Detected package downgrade for Boilerplate Application(.NET Core 3.1)

I'm trying to open my Boilerplate Application(.NET Core 3.1)in VSCode in Linux but below exception, keep appeared for me. Is there any difference between .NET Core for Linux and for Windows or What is the problem?
Detected package downgrade: Abp.ZeroCore from 5.7.0 to 5.1.0. Reference the package directly from the project to select a different version.
No this is not related to the OS that you run your application.
As stated in the error message there a downgrade in one of your nuget packages.
Go to your Boilerplate.csproj and try to manually set the version of Abp.ZeroCore nuget package from 5.1.0 that it is currently to 5.7.0.

Which version of Microsoft.AspNet.Mvc is supported by .NETCoreApp v2.2?

I am working on a Ubuntu 18.04 environment using Visual Studio Code and .NET Core v2.2.
After including a few existing projects into a solution that I'm working on, I ran into errors when I tried to compile stating that the namespace "Microsoft.AspNet.Mvc" could not be found.
So, I added a package reference for the projects that were complaining by using the dotnet CLI:
dotnet add package Microsoft.AspNet.Mvc --version 3.0.20105.1
But now when I try to dotnet restore or dotnet msbuild the solution file, I'm getting warnings reporting that:
warning NU1701: Package 'Microsoft.AspNet.Mvc 3.0.20105.1' was
restored using '.NETFramework,Version=v4.6.1' instead of the project
target framework '.NETCoreApp,Version=v2.2'.
This package may not be fully compatible with your project.
I would like to figure out which package version of Microsoft.AspNet.Mvc I need to install in order to be compatible with .NET Core v2.2.
I realize that this is just a warning and using the .NETFramework v4.6.1 may be okay, but I have been debugging a very strange issue that is only happening on a Ubuntu environment, so I would like to determine whether package versioning is a problem.
I have tried Google searching to determine which version of MVC is compatible with .NET Core 2.2, but I have yielded any useful results.
Does anyone know the answer to this question? Or would you be able to point me in the direction of a source that can answer it?

This package may not be fully compatible with your project

Hi Guys I am using visual studio 2017 to build Xamarin.Forms mobile app.
I installed 'Microsoft.Net.Http 2.2.29' Package from NuGet packages
but i got this warning message :
Package 'Microsoft.Net.Http 2.2.29' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
How can I fix it ??
The Solution is delete the reference and use the HttpClient declared in Namespace: System.Net.Http. its worked with me and no warning message:)

Could not install package 'Splat 2.0.0'

Trying to install Splat 2.0.0 into Xamarin Forms project results with error:
Could not install package 'Splat 2.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', 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.
How to resolve this issue please?
Thanks,
AG
I found this on the GitHub of your tool:
Please use Splat 1.6.2 when targeting PCL projects. v2.0 and onwards is netstandard only. There will be no updates to the 1.6.x series so if you need to patch the release then please fork and maintain your own copy/build from source.
It seems they stopped supporting PCL. So as a solution I suggest using Splat 1.6.2 as that seems to support ¨PCL. Good luck

Resources