Search code examples
c#xamarinvisual-studio-2015monogamefarseer

MonoGame trying to use Farseer. Error: Could not load assembly - doesn't exist in the Mono for Android profile


I've been struggling with this error for far too long. Xamarin bugzilla seems to have claimed a fix, but after using their latest version, nothing seems to work. I've read this:

System.IO.FileNotFoundException: Could not load assembly...perhaps doesn't exist in the Mono for Android Profile?

But it seems the solution is specific to that assembly, and not this one.

Error

  Error XA0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com. Reason: System.IO.FileNotFoundException: Could not load assembly 'FarseerPhysics MonoGame, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? (1, 1)

How to replicate:

  1. Download and use Monogame (Visual studio 2015)
  2. Download Farseer Physics Engine https://farseerphysics.codeplex.com/
  3. Create new Android project
  4. Select solution > add existing project > select "Farseer Physics MonoGame"
  5. Add reference to Farseer Physics MonoGame assembly

Note: When adding a reference the existing project, (step 5) I get a warning message:

Severity Code Description Project File Line Suppression State Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. New Project 1 Active

I'm very desperate to fix this. Keep in mind I'm a noob at this stuff. Thanks in advance.


Solution

  • I'm using Farseer Physics for a 2D phsyics game I'm developing currently.

    To use Farseer for Android, you need to create a new Android Library project and import all of the source files for Farseer into this new Android Library Project.

    You will also need to add the references too Monogame for Android.