Hustler
Hustler

Reputation: 13

"Cannot add the libraries to incompatible component" when adding JSON.NET to Xamarin project

I got this error while adding JSON.NET component into my Xamarin iOS app.

The error message is:

error adding to project: cannot add the libraries to incompatible component

How to solve this?

Upvotes: 0

Views: 1369

Answers (2)

Matt Ward
Matt Ward

Reputation: 47917

I suspect the reason you are getting the "cannot add the libraries to incompatible component" is because you have an old version of Xamarin Studio installed.

The latest Json.NET component from Xamarin's Component Store is a shell component and only installs the Json.NET NuGet package. If you have an old version of Xamarin Studio you will not be able to install Json.NET from the Component store. You need at least Xamarin Studio 5.5 to install Json.NET from the Component store.

Another alternative is to install the Json.NET NuGet package instead of the component from the Component store. You can do that by selecting your project, right clicking and selecting Add - Add Packages.

Upvotes: 0

Patrick Hofman
Patrick Hofman

Reputation: 156958

Since Xamarin doesn't support the full .NET framework, there is a slimmed down version of JSON.NET that is a specific PCL (Portable Class Library, also here on the Xamarin site) written for Xamarin.

See the Xamarin components site for the JSON.NET version for Xamarin.

Upvotes: 1

Related Questions