Monogame OnResume Bug? Can't resume properly, GL_INVALID_OPERATION

First off, I don’t want to sound like this is a complaint, MonoGame is absolutely fantastic. I just don’t know how to fix this.

Android builds can never resume the game gracefully. I’ve been working with XNA/MonoGame for a little while now, and I’ve always assumed I was doing something wrong, but it appears to be in the binaries.
In short, both the home button and the back button can never resume the game, even though Game.Tick() is being called.

when the game is resumed, and MonoGameAndroidGameView.CreateFrameBuffer is created, as soon as GraphicsDeviceManager.ResetClientBounds is invoked, the following error appears:
<__load_uniform_float:802>: GL_INVALID_OPERATION

I have downloaded the platformer sample to test this, and the bug is present when using the latest build (#1368) however it is not present in the NuGet binaries.
I have also tested this in the default blank game projects, and it cannot resume the simple text “hello from monogame”

I have looked into it for the last couple days, and there are a couple topics but mostly very outdated and I haven’t found a fix.
I have tried overriding the complete android lifecyle (OnPause, OnResume, OnDestroy) and haven’t found a way to bring the game back using the latest binaries.

Has anyone found a way to do this? All I want is for the player to be able to hit the home button and be able to come back to the game again.

So resume works fine on the 3.2 nuget packages, but doesn’t work with the latest build from the buildbot?

We’ve had a few related PRs lately, maybe you could make up a test project and post it on the github issue tracker?

Yea, it’s as simple as installing the latest Visual Studio build, and creating a new project from one of the templates. The game runs fine, until the home button is pressed and then the game is opened again from recents. It appears that it doesn’t draw anything from spritebatch (although spritebatch.clear still shows the default cornflowerblue).

I will take a look at the issue tracker, thanks.

I’ve created a GitHub project that illustrates this problem. Tested on a Nexus 5 and a Samsung Galaxy S, both running Android Version 4.4.4

The GitHub is here:
github.com/mrEmo/ProblemGame/tree/master

And the issue tracker here:

And a StackOverflow question here:
stackoverflow.com/questions/26370468/monogame-android-cant-resume-game-blank-screen

Can you check if this PR fixes your issue: https://github.com/mono/MonoGame/pull/2816 ?

@andrey_timofeev
unfortunately no luck =(

Although before the nexus would quietly throw the GL_INVALID_OPERATION, and now it actually halts and throws the error:
Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidOperation

Also, just to reiterate, using the version present in the nuget packages fixes this issue. I just tested it on the github project I created (sanity check) and indeed, everything works when I use the older nuget build.

Hello. I just started trying monogame out and without further checking what error gets raised it sounds just like what I am experiencing too.
Is this officially a bug now or not?
@MrEmo did you happen to find an answer or a workaround somewhere else?

Edit: Uhm… excuse me for reviving this thread. On mobile it showed October 14th and seemed more recent but after my reply it says ‘5 years later’ … Sorry about that!