Search code examples
androidiosxamarinrealmfody

Xamarin Realm in shared project, error "Fody not properly installed"


I’m trying to add Realm to Xamarin project.

Project contain two platform-specific projects (Android and iOS) and PCL (.NET framework).

I can successfully add realm separately to each platform, but when I’m trying to move my code to PCL, I have an error “Fody not properly installed. PCLNamespace.MyRealmObject is a RealmObject but has not been woven.”.

I added NuGet Realm package to each project and PCL.

I tried Realm documentation FAQ “Failing to Weave” and most of solutions from similar issue "Xamarin android Crash"

Non of that helped.


Solution

  • Finally I found what was blocking PCL to use realm. I’m posting an answer for those who would come across similar issue.

    When I created new PCL I could add and use Realm without any errors. Making a diff of both PCLs give me an answer; faulty PCL had Microsoft.Bcl.Build packages, and when I delated it from project packages (via Xamarin Studio) that fix an issue.

    Although I fix my issue, I’m not understanding how packages could block functionality of the other, so if somebody know an answer for that I would appreciate a comment:)

    Thanks