Can not install the packages in Xamarin Studio on Mac - macos

I am newbee on Xamarin. I have created a Xamarin.Forms project with iOS and Android platforms. I am trying to add Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory package but getting following error Could not install package 'Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory 4.0.209160138-alpha'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarintvos10+xamarinwatchos10+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.

Related

Why can't I add my NuGet package to my app in Visual Studio?

I'm using Visual Studio for Mac on macOS Big Sur (11.2.3) to try to create a cross-platform NuGet package encapsulating common logic to be added to some Xamarin.Forms mobile apps.
I begin by creating a new solution and choosing Multiplatform -> Library -> Multiplatform Library. Under Target Platforms: I check the boxes for both iOS and Android. Under Implementation: I check Platform specific.
I add the platform-specific code to the iOS and Android projects, and shared code to the Shared directory, with no problem. The NuGet package builds without error.
But when I try to add the package to one of the Xamarin.Forms apps, VS raises the error Could not add packages and writes this to the package console:
Package <my package name> 1.0.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package <my package name> 1.0.0 supports:
- monoandroid11.0 (MonoAndroid,Version=v11.0)
- xamarinios10 (Xamarin.iOS,Version=v1.0)
I did try adding <TargetFramework>netstandard2.0</TargetFramework> to the .csproj files in the library projects, but that caused an explosion of errors that made it clear that was the wrong approach.
This is outside my existing expertise, and I'm at the end of my limited understanding. How do I build/modify this package so that it can be added to a mobile app solution?

Cannot install NuGet packages to PCL - "package does not contain any assembly references or content files that are compatible with that framework"

I am trying to follow a tutorial on consuming web services in Xamarin Forms. I created a fresh project and have tried to install Refit, that didn't work so I tried to install RestSharp. I can install both of these libraries to my Droid / iOS projects, but not to the PCL. I get the following error in Visual Studio:
Could not install package 'Refit 4.0.1'. 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. For more information, contact the package author
Could not install package 'RestSharp 106.2.1'. 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. For more information, contact the package author
I've found this post on the xamarin forums, but it didn't fix my issue. My project is fresh, everything is up to date... Does anyone know how I can fix this issue?
vents XF is supposed to make developing cross platform apps faster & easier, but i think I'd have done this poc in native ios/droid twice in the time it's taken me to install a library to a blank project! :)
This happens because RestSharp it's not compatible with PCL-library. So you will have to handle whatever you're trying to do in platform specific.

Could not install packages into .netportable project

I'm new to mobile development & Xamarin. I'm trying to install a 3rd party nuget package "BottomNavigationBar" to my portable project in Xamarin solution. But facing the below error while doing so.
Could not install package 'Xamarin.Android.Support.Compat 24.2.1'. 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.
I'm having Xamarin.Forms version 2.3.4.247, with Android target framework "Android 7(Nougat)". And I have Android SDK installed with API 24.
Any help is appreciated.
As SushiHangover says this component targets Xamarin.Android only so it will be impossible to install in the PCL project.
You should use a similiar plugin that targets Xamarin.Form, this plugin is called: BottomNavigationBar.XF
You can see their source code here: https://github.com/thrive-now/BottomNavigationBarXF

Cocossharp support for Xamarin.Mac

I am looking to develop a game using cocossharp targeting Mac. When I am trying to add NuGet packages, CocosSharp packages are failing to add with the following error:
Could not install package 'CocosSharp 1.7.1'. You are trying to
install this package into a project that targets
'Xamarin.Mac,Version=v2.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.
Could someone explain which is the right package or if there was a versioning problem that I am hitting into here.
I also noticed the - http://mono.github.io/CocosSharp/ where I see an issue "#371 CCGameView: Add Mac support" marked to be part of the next release. Does that mean, Cocossharp is currently not supported on Mac?

How to install 'MvvmCross.HotTuna.MvvmCrossLibraries 4.0.0-beta3' on Xamarin PCL?

Following this tutorial I'm trying to install MvvmCross.HotTuna.MvvmCrossLibraries in Core project. The latest version of this library 'MvvmCross.HotTuna.MvvmCrossLibraries 4.0.0-beta3'.
After adding Nuget Package I have the following error:
Could not install package 'MvvmCross.HotTuna.MvvmCrossLibraries 4.0.0-beta3'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.0,Profile=Profile14', 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.
Does anyone know what the problem is?
Answer to original question:
MvvmCross is not available for ASP.NET. You need to use it in one of the compatible frameworks like UWP, Xamarin.Android, Xamarin.iOS or a PCL.
Updated Question:
MvvmCross uses at least .NET 4.5 with profile 259. Switch to those to be able to install the libraries.

Resources