I got this error while adding JSON.NET component into my Xamarin iOS app.
The error message is:<blockquote>
error adding to project: cannot add the libraries to incompatible component</blockquote>
How to solve this?Answer1:
Since Xamarin doesn't support the full .NET framework, there is a slimmed down version of JSON.NET that is a specific PCL (<a href="http://msdn.microsoft.com/en-us/library/vstudio/gg597391%28v=vs.100%29.aspx" rel="nofollow">Portable Class Library</a>, also <a href="http://developer.xamarin.com/guides/cross-platform/application_fundamentals/pcl/introduction_to_portable_class_libraries/" rel="nofollow">here on the Xamarin site</a>) written for Xamarin.
See <a href="https://components.xamarin.com/view/json.net/" rel="nofollow">the Xamarin components site</a> for the JSON.NET version for Xamarin.Answer2:
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.