Tuesday, September 9, 2014

Setting up MonoGame for iOS in Xamarin Studio

This is a walk-through for setting up MonoGame on an iOS device in Xamarin Studio.

NOTE: The nuget-packages currently does not support 64-bit. I'm sure it will be updated soon.

Create a new iOS project

Create a new solution and add an empty Universal iOS project.

Add the MonoGame nuget package

Right-click the iOS project and select Add -> Add Packages..


Search for MonoGame and select the first package that contains the project Templates.

Rereference the binaries

For some reason, the binaries isn't references correctly. If you build now it will not find any Xna/MonoGame related stuff.

Right-click the iOS project and select Edit References. Navigate back to the projects root folder and then down to Packages/MonoGame.Binaries.3.2.0/build/MonoTouch. Select both assemblies and click the Add button.

Delete the old startup stuff

Remove/delete AppDelegate.cs and Main.cs.

Build and run

The app will hopefully start up with the standard cornflower blue shade of nothingness.



All you have to do now is create a game and get rich!



6 comments:

  1. Thank you very much for this, far superior to any tutorials on Xamarin or Monogames sites.
    In short, you are a modern day super hero!

    ReplyDelete
  2. I have been struggling to do this for over a week now. I have tried this with Visual Studio 2010 on Windows and Xamarin Studion on my Mac. Every time I do it I get the same error.
    "Could not install package 'MonoGame.Binaries 3.2.0'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework."

    I have scoured the internet trying to find a solution to this but nothing that I have tried has worked. I have tried the MonoGame 3.2.99-alpha package. This installs but when I try to deploy to my device I get an error that there is a missing reference to Mono.Android.

    Can you please shed some light on to what I am doing wrong? I have a game that I have coded that works on Android with no issues but I can't get it to port to iOS.

    Thanks in advance.

    ReplyDelete
  3. Yes, that's a great news to us and sure that it will be very effective to me as well. I hope that game lovers must be happy to know this as well. Thanks!!

    ReplyDelete