Couldn't install package, project targets Framework without assembly references - c#

When I try to install Firebase Messaging Nuget package on the solution it gives me this error -
"Could not install package 'Xamarin.Firebase.Messaging 42.1021.1'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', 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."
And for the android installation it says
"Could not install package 'Xamarin.Firebase.Messaging 42.1021.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.6,Profile=Profile44', 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 do I get it to install?

The solution is to use the latest stable Xamarin.Forms and have your project's compileSdkVersion (so Target Framework) set to 7.0 or higher. You will then be able to install newer versions of Android Support and therefore Google Play Services packages.
Happy coding!!

Related

Microsoft.Rest.ClientRuntime can not be installed in Xamarin PCL Project

I tried to add Microsoft.Rest.ClientRuntime v2.3.10 via Nuget to a standard Xamarin PCL project and got following error:
Could not install package 'Microsoft.Rest.ClientRuntime 2.3.10'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', but the package does not contain any assembly references or content files that are compatible with that framework.
The targets for the project as as follows:
Solution was just to install version 2.0.0 of Microsoft.Rest.ClientRuntime, which is portable.

Error installing Xamarin.Auth from NuGet

When installing Xamarin.Auth to my project with NuGet, I get this error:
Could not install package 'Validation 2.0.4.14103'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', 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.
This is because the NuGet dependency behaviour is set to 'lowest' and Validation 2.0.4.14103 is not compatible with Xamarin.iOS,Version=v1.0
Here is a workaround:
Install the Validation NuGet package first, using the latest version 2.3.7.
Then install Xamarin.Auth, and it should work as expected without the error.

Can't install NuGet-Packages (Xamarin Android project)

I have a problem with NuGet installing the "Xamarin.JOSE.JWT" package. I get the following error:
> Could not install package 'Xamarin.JOSE.JWT 1.0.3'. You are trying to
> install this package into a project that targets
> 'MonoAndroid,Version=v6.0', 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.
Is this a known problem or is there a workaround for this?
Xamarin.JOSE.JWT 1.0.3 does not support Xamarin.Android projects. It only contains assemblies for .NET Framework 4.0.
Your options are:
Find another NuGet package that does support Xamarin.Android projects.
See if you can compile the Xamarin.JOSE.JWT project against Xamarin.Android.
Open an issue on the Xamarin.JOSE.JWT GitHub repository.
Try directly referencing the jose-jwt.dll from the NuGet package and see if it works with an Android project. This may not work if it is using parts of the .NET Framework not supported by Xamarin.Android.
Use the Xamarin.JOSE.JWT NuGet package on the server side and not in the Android project.

How to make a NuGet package for this PCL library

I'm trying to create a nuget package for a PCL library I've made.
This nuget package is intended to be used in a Xamarin Forms application though. So I'm not even sure if the things I've ticked are correct.
I really only care about .NET Framework 4. That is my bare minimum framework. For the rest, I don't care at all and have no idea what I should be targetting.
For what it's worth, I'm using NuGet Package Explorer to create my NuGet nupkg files to manually test them before I publish them to NuGet.
Here's a screenshot of what I was trying, but Xamarin Studio failed to add the nuget package (saying it wasn't the right something-or-rather).
and the error message from Xam Studio:
Adding Foo...
Adding 'Foo 1.3.0' to Core.
Could not install package 'Foo 1.3.0'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', 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.
For Xamarin.Forms the two profiles that are good ones for your Portable Class Library (PCL) project to use are Profile 78 or Profile 259. Xamarin.Forms can be used in other profiles but if your PCL project targets one of these you should be OK. Your project looks to be targeting Profile 78.
Here are the Xamarin.Forms PCL profiles for reference.
Xamarin.Forms 1.3:
portable-win+net45+wp80+MonoAndroid10+MonoTouch10
Xamarin.Forms 1.4:
portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10
The problem with your NuGet package that it does not indicate that it supports Windows 8 in the PCL. NuGet will look at all the individual frameworks that make up the project's PCL profile (ignoring the Xamarin and Mono ones since they are optional if you do not have them in your NuGet package's PCL profile) and ensure that the NuGet package's PCL profile has a framework which is compatible. If the NuGet PCL does not have a matching framework then NuGet considers it incompatible.
So your NuGet package's portable library folder would need to include win
portable-net4+sl5+wp8+win
Then you can install your NuGet package into your Profile 78 PCL project.

NuGet: Could not install package VVVV.EmguCV 2.4.2.1

I'm using Visual Studio 2013. I create a new project Windows Form Application (C#), with target framework in tab Application in Properties of the my project: .NET Framework 3.5.
When I open NuGet and search EmguCV and click install show this error:
Installing 'VVVV.EmguCV 2.4.2.1'.
Successfully installed 'VVVV.EmguCV 2.4.2.1'.
Adding 'VVVV.EmguCV 2.4.2.1' to RadarOCR.Desktop.
Uninstalling 'VVVV.EmguCV 2.4.2.1'.
Successfully uninstalled 'VVVV.EmguCV 2.4.2.1'.
Install failed. Rolling back...
Could not install package 'VVVV.EmguCV 2.4.2.1'. You are trying to install this package
into a project that targets '.NETFramework,Version=v3.5', 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.
I do not know what's wrong! Help-me please!
The error message tells you what the problem is:
You are trying to install this package
into a project that targets '.NETFramework,Version=v3.5', but the package does not contain
any assembly references or content files that are compatible with that framework.
The VVVV.EmguCV NuGet package does not support being installed into a project that targets .NET 3.5.
Looking inside the VVVV.EmguCV NuGet package it has custom MSBuild target files for .NET 4.0 and no other .NET framework version. So if you want to install it you would need to change your project so it targets .NET 4.0 or higher.

Categories

Resources