Reputation: 479
I've installed Realm via Nuget into my Xamarin PCL and my Android project, and when I try to run any lines of Realm code I get the following exception:
System.PlatformNotSupportedException: The PCL build of Realm is being linked which probably means you need to use NuGet or otherwise link a platform-specific Realm.dll to your main application.
I've studied the various Realm forums, the typical suggestion is to make sure each device project also has the Realm package installed into it, which I already have, so that isn't the solution. Any ideas on how to resolve this?
Upvotes: 1
Views: 436
Reputation: 24460
Open up your csproj files for each of the platform specific projects. Make sure that the dll referenced in there comes from the platform specific folder in the NuGet package.
If you are seeing this error you will most likely see it coming from portable-net45+sl5+wp8+wpa81+win8+monoandroid+Xamarin.iOS10+Xamarin.Mac
.
You would want that reference to point at MonoAndroid44, Xamarin.iOS10, Xamarin.Mac etc. Not the portable. Fix this, and you will fix your exception.
Upvotes: 2