Could not install packages into .netportable project - xamarin

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

Related

xamarin forms socketioclientdotnet

I'm not sure if this is a Visual Studio issue or a genuine incompatibility but trying to install SocketIoClientDotNet into a Xamarin forms PCL project I get
Could not install package 'SocketIoClientDotNet 1.0.6'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile7', 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.
The project targets .NetFramework 4.5 which seems to be supported by the package - what could be going wrong here?
I suggest you add the following packages in your .Droid and .iOS projects (and not in the "common" project):
EngineIoClientDotNet (v.0.9.22)
SocketIoClientDotNet (v.0.9.13)
WebSocket4Net (v.0.14.1)
These versions of packages were the stablest 6 months ago when I had to use sockets in my project. If you want more information don't hesitate to ask me!

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.

Can not install the packages in Xamarin Studio on Mac

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.

Xamarin.Forms Package Erorr

Has anyone encountered this error when adding the Xamarin.Forms package through the "Add NuGet package" option?
PS I'm using Xamarin Studio and I only encounter this with Windows.
Error message is:
Could not install package 'Xamarin.Forms 2.2.0.31'. You are trying to
install this package into a project that targets
'.NETFramework,Version=v4.5,Profile=Profile78', but the package does
not contain any assembly references or content files that are
compatible with that framework.
Here is the screenshot
You are having a profile which has portable class Profile78.Profiles are the type of your portable class where you select the target projects which can use your PCL. The more you select the less functionality can be provided.
You need to change it to another one. Usually most classes (including Xamarin.Forms) are supporting Profile111. Profile111 is a profile which does not support Silverlight in contast du Profile78. So you need to go to Properties and deselect Windows Phone Silverlight and Silverlight. You can select everything else (.Net 4.5, Windows 8, Windows Phone 8.1, Android, iOS/iOS classic and ASP.NET Core 1).
Then try adding Xamarin.Forms again.
You can see more information with a list of all(?) profiles here.
Here you see how to change in Visual Studio project Properties:
And here in Xamarin Studio project Option:
The problem is that you do not have the Portable Class Library (PCL) profiles installed on Windows. Xamarin.Forms 2.2.0.31 supports Profile78 so changing it to Profile111 will not fix the problem.
The error message itself indicates that this is the problem since it refers to Profile78. If the NuGet package was really incompatible then NuGet would show the frameworks in the PCL profile in its error message not the profile number. If I try to install Xamarin.Forms 2.2.0.31 into a PCL project that targets Profile1 which is not supported by Xamarin.Forms then I get an error:
Could not install package 'Xamarin.Forms 2.2.0.31'. You are trying to install this package into a project that targets 'portable-net40+sl40+win+wp+Xbox40', 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.
Note that Profile1 is not mentioned.
There are detailed instructions on installing Portable Class Libraries for Xamarin Studio which I will summarize here:
To install the Portable Class Libraries on Windows you have three options:
Install Visual Studio 2013 (full or Express version). Update 2 or
above is required.
Install the Portable Library Tools and the Portable Library Reference Assemblies 4.6.
Install the Portable Library Tools and copy the .NETPortable directory from Mono over to Windows.

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