I have not been this frustrated in my entire life.
I was hoping to finally port a game to Android, and then I get hit in the face by Android and its errors.
I find no help online, and I’m a good googler.
It feels like I am the only one in the world that does not get Android to work, so I will have to try to get some help here, I guess.
Please help me, I will try to explain the problem as good as I can.
So, I have a perfectly working game on XNA, which I then ported to Windows Phone 7.1, which works perfectly fine, which I then ported to Android through Xamarin and MonoGame.
But then shit hit the fan, so to speak.
The first thing that happened was that the emulator just doesn’t work, it gives this error:
Failed to create desired format, falling back to defaults
Then crashes. So on the forums it says that that happens on every emulator that is not above version Android 4.0.3, but it doesnt work even on Android version 4.0.3, or any other version. So I have to borrow someone else’s Samsung S3. Which gives other errors.
The second thing that happened was that when I try to define a variable with the value from the display’s width and height, graphics.GraphicsDevice is null.
ScreenDimension = new Vector2(this.graphics.GraphicsDevice.DisplayMode.Height, this.graphics.GraphicsDevice.DisplayMode.Width);
Why? I have no idea. So I googled that and found this: http://stackoverflow.com/questions/4028756/xna-graphicsdevice-initialization-confusion
There it says that I need to add this above the previously mentioned code:
this.graphicsDeviceManager = this.Services.GetService(typeof(IGraphicsDeviceManager)) as IGraphicsDeviceManager;
if (this.graphicsDeviceManager != null)
All this is done in the Constructor in Game1.cs
But when I did that, it gets even weirder.
Nothing will load, it never even gets to the LoadContent function (??), everything is null, everything is “Unknown Identifier”, and so on. I don’t understand. I have made the content to .xnb, but it doesn’t work. SpriteFont is an unknown identifier, Vector2 is an unknown identifier… It just goes on and on…
I finally managed to get the game to get to the Update function, but it just stops first to tell me that the thing I try to update is null, because the game never even gets to LoadContent, where that variable get defined.
I don’t understand anything, it seems to work for everyone else.
Please download my project and test by yourself:
Any help is extremely appreciated.