I have a MonoGame Android project that holds a reference to a MonoGame PCL project. From the Android project, I call into some of the classes in the PCL. In the PCL, I have a few calls to spriteBatch.Begin(). Whenever I run the code and it gets to the spriteBatch.Begin() line, the compiler ends up throwing a System.MissingMethodException. I cant seem to figure out why this is happening. My PCL project targets Android so i dont think thats the issue. Im not sure if I need to include another reference or not or if perhaps spriteBatch.Begin() cannot be called in PCL’s.
Heres the StackTrace:
System.MissingMethodException: Method not found: ‘Microsoft.Xna.Framework.Graphics.SpriteBatch.Begin’.
09-13 20:51:49.363 I/MonoDroid( 7008): at Tilt.TD.Game1.Draw (Microsoft.Xna.Framework.GameTime) [0x00093] in e:\Projects\Git\Tilt\Tilt\Tilt.TD\Game1.cs:130
09-13 20:51:49.363 I/MonoDroid( 7008): at Microsoft.Xna.Framework.Game.DoDraw (Microsoft.Xna.Framework.GameTime) <IL 0x0001e, 0x000ff>
09-13 20:51:49.363 I/MonoDroid( 7008): at Microsoft.Xna.Framework.Game.Tick () <IL 0x001f5, 0x00c8f>
09-13 20:51:49.363 I/MonoDroid( 7008): at Microsoft.Xna.Framework.AndroidGameWindow.OnUpdateFrame (object,OpenTK.FrameEventArgs) <IL 0x00059, 0x00237>
09-13 20:51:49.363 I/MonoDroid( 7008): at OpenTK.GameViewBase.OnUpdateFrame (OpenTK.FrameEventArgs) [0x00014] in /Users/builder/data/lanes/monodroid-mlion-monod
Any help would be greatly appreciated.
Thanks.