Can't install NuGet packages in Xamarin Forms - xamarin.forms

I am trying to install a NuGet package in Xamarin Forms and in all the ones I try to install I get the same error.
"Package X is not compatible with netstandard2.0"
click to enlarge
The package I want to install is this: https://www.nuget.org/packages/Refractored.FloatingActionButton/.
Any idea how to fix this error?

The plugin Refractored.FloatingActionButton is for Xamarin.Android . In your case you need to install the package Refractored.FloatingActionButtonForms

Related

I tried to install Xamarin.Android.Support.v4 on Xamarin Project.But it shows errors

Severity Code Description Project File Line Suppression State
Error Could not install package 'Xamarin.Android.Support.v4 28.0.0.3'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', 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.
If Manage Packages is for Forms project , can not install Xamarin.Android.Support.v4 nuget package .(AppEntryTest is name of my project)
You need to open Manage Packages for Solution (Right click solution -> select Manage Nuget Packages for solution..)
then can install as follow :

Xamarin.Firebase.Database Compatibility Issue

I have created a Xamarin Andoid project (Not a Xamarin Forms project) using Visual Studio 2019 and it is working fine (No any code changes done). By default it has these Nuget packages installed:
I tried to install Xamarin.Firebase.Database latest version (71.1601.0) and got this error.
Then I tried to install the previous version (60.1142.1) and it got installed. But When I try to build the project I got this error.
I am unable to run the project so how can I resolve this issue?
If you just install the Xamarin.Android.Support.v4 28.0.0.3, you still cannot install Xamarin.Firebase.Database (71.1601.0), you should install following nuget packages.
Xamarin.Android.Support.Compat (>= 28.0.0.3)
Xamarin.Android.Support.Core.UI (= 28.0.0.3)
Xamarin.Android.Support.Fragment (= 28.0.0.3)
Xamarin.Android.Support.Annotations (= 28.0.0.3)
Xamarin.Android.Support.VersionedParcelable (= 28.0.0.3)
I installed Xamarin.Firebase.Database latest version (71.1601.0) successfully, Here is my screenshot.
i got same error a week ago. Remove adroid native nuget packages all from your adroid part. Then install your package. if you need, then install your android packages.
I had one packages installed named "android.support.*****". Searched but couldnt find solution easily. Compiler suggests that installing so many packages. I removed the one android package then i could installed the xamarin packages.
I had a similar error and solved it as follows. My error was an Xamarin.Firebase.Common (71.1610.0) installation error. Error disappeared after installing Xamarin.Android.Support.v4 "(28.0.0.3). Hope it helps
Xamarin.Essentials has a dependency on Xamarin.Android.Support.v4 28.0.0.3 while Xamarin.Firebase.Database has a dependency on Xamarin.Android.Support v4 28.0.0.1. The error message is telling you to directly add a reference to Xamarin.Android.Support.v4 28.0.0.3. That should fix the problem for you.

How do i install the Twilio package in Visual Studio using NuGet manager?

Please help me with the Twilio package installation in Visual Studio. I get the following error message when I try to install through NuGet manager.
Attempting to resolve dependency 'JWT (≥ 1.3.4)'. 'Twilio' already has
a dependency defined for 'Microsoft.IdentityModel.Tokens'.
thanks to all am ok now I updated the nuget manager to the latest version

Installing Google.Cloud.Datastore.V1 package on .Net core

I'm using .netcore 1.0.1 on Ubuntu 16.04. When tying to add the Google.Cloud.Datastore.V1 package to my project (dotnet add package Goolge.Cloud.Datastore.V1) I get the following error:
Unable to resolve 'Google.Cloud.Datastore.V1' for '.NETStandard,Version=v1.5'. The package mentions it support .NetStandard 1.5. I tried installing it with the -Pre tag but dotnet add package doesn't like the -Pre.
Can anyone point me in the right direction?
Google.Cloud.Datastore.V1 now available only as a prerelease package. dotnet add package Google.Cloud.Datastore.V1 tries to install the last released package and so cannot find any suitable one.
As right now dotnet add doesn't support -prerelease flag, you need to specify prerelease version directly to install it:
dotnet add package Google.Cloud.Datastore.V1 -v 1.0.0-beta08

NuGet: 'X' already has a dependency defined for 'Y'

I'm getting the following error in NuGet while trying to install package Microsoft.AspNet.Server.IIS
Attempting to resolve dependency 'Microsoft.AspNet.Loader.IIS.Interop (≥ 1.0.0-alpha4-10330)'.
Attempting to resolve dependency 'Microsoft.AspNet.Loader.IIS (≥ 1.0.0-alpha4-10330)'.
'Microsoft.AspNet.Loader.IIS' already has a dependency defined for 'Microsoft.AspNet.FeatureModel'.
How to resolve it?
UPDATE:
Also, I'm getting the following:
Attempting to resolve dependency 'Microsoft.Framework.DependencyInjection (≥ 1.0.0-alpha4-10326)'.
'Microsoft.Framework.DependencyInjection' already has a dependency defined for 'Microsoft.Framework.ConfigurationModel'.
This was resolved by installing the latest NuGet Package Manager:
https://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca
Don't forget to restart Visual Studio.
I fixed a similar issue in my solution by:
Opening up a command prompt
Navigating to the .nuget folder in my solution
Running nuget update -self
This upgraded the copy of NuGet.exe that was in my solution from 2.8.0 to 3.4.4, which fixed the 'X' already has a dependency defined for 'Y' error that was stopping it from downloading SSH.NET automatically before building.
(If your solution doesn't have a copy of NuGet.exe in it - and it might not - then you should try the solution in TN's answer instead)
I tried the update, but it did not work for me. Helped:
Uninstall NuGet => Tools => Extensions and update => Installed
Install NuGet
Reload Visual Studio
I faced this error on outdated version of Visual Studio 2010. Due to project configuration I was not able to update this version to newer. Therefore, update of NuGet advised above did not fix things for me.
Root reason for the error in this and similar situations is in dependencies of the package you try to install, which are not compatible with .NET version available in your project.
Universal solution is not obligatory update of Visual Studio or .NET but in installation of older NuGet versions of the same package compatible with your system.
It is not possible to tell for sure, which of earlier versions will work. In my case, this command installed the package without any NuGet updates.
Install-Package X -Version [compatible version number]
I was getting this issue on our TeamCity build server. I tried updating NuGet on the build server (via TC) but that didn't work. I finally resolved the problem by changing the "Update Mode" of the Nuget Installer build step from solution file to packages.config.
I was getting the issue 'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp' on the TeamCity build server.
I changed the "Update Mode" of the Nuget Installer build step from solution file to packages.config and NuGet.exe to the latest version (I had 3.5.0) and it worked !!
Go to the link https://www.nuget.org/packages/ClosedXML/0.64.0
Search your NuGet packages
See the all version of related packages
Install the lower version of packages
In my case I had to delete the file NuGet.exe in the Project folder/.nuget and rebuild the project.
I also have in NuGet.targets the DownloadNuGetExe marked as true:
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">true</DownloadNuGetExe>
Hope it's helps.
The only solution that worked for me was to uninstall nuget completely from Visual Studio 2013 and then install it again with the obligatory restart of VS in between.
Go to Tools.
Extensions and Updates.
Update Nuget and any other important feature.
Restart.
Done.
In a project using vs 2010, I was only able to solve the problem by installing an older version of the package that I needed via Package Manager Console.
This command worked:
PM> Install-Package EPPlus -Version 4.5.3.1
This command did not work:
PM> Install-Package EPPlus -Version 4.5.3.2

Resources