[cocos2d-x 2.0] black screen phenomenon in android lollipop

This phenomenon occurs when the black screen resume pause the game. How do I handle this?
help me :frowning:

Is your game freezing when background music is supposed to play? That’s a known bug. If that’s what you’re dealing with, look here (ignore the 3.2 in the title, @corytrese mentions a fix for 2.x ).

1 Like

@Jgod Thanks man… we were trying to figure out why the background music wasn’t working :smile:

Did you get the patch to work? I’ve been able to successfully deploy across all Android versions now with it.

Can you give an exact set of steps?

  1. Open the game
  2. Press “Home” button
  3. Press “app switch” button
  4. Resume the game
  5. Freeze!

Something we can use to understand what your issue is.

My version of Cocos2d-x (2.2.0) does not have any issues with pause/resume on Android.

The procedure is as follows .

  1. Open the game
  2. Press “Home” button
  3. Press “app switch” button
  4. Resume the game
  5. The sprite background turns black .

Got a running solution working for issue with background music for Cocos2dx v2
My issue was BG Music was not playing at all and rest of the sounds were playing. So tried to debug and found the issue with Mediaplayer with the latest Lollipop update.

If anyone needs to see this, here is the link:

I think I jumped the gun on @sjm0229’s problem (unless he’s having that one too, everyone is/was). Looks like some OpenGL texture related thing (I don’t know enough about it).

If he’s using 2.0 (baseline version, not latest 2.x version with patches) I remember there being the issue of textures turning black when losing OpenGL “focus”. A patch solved most of those problems.

Some searching around gave me links you might find helpful (similar problem):

Did you have this problem pre-lollipop?
That looks like the default HelloWorld scene, but did you add anything yourself? Anything to reproduce will help.

I just had this happen consistently but only on one model of LG (Volt LGLS740). I went out and bought one of these since of our 30 beta testers 3 had these phones and sure enough it did do this exactly.

To keep this from happening I removed the target SDK from the manifest.

O.o
I am not even sure why I thought to try this. I was playing around with changing targets to see if the SDK target mattered. And I accidentally left it off altogether. Anyway, I don’t like shipping a game without specifying a target, but its bound to happen else where, this means we might break in the future… so use with caution knowing what might occur next release of an Android OS. I mean its not like Google would do something core to functionality… like change media player so it all of a sudden doesn’t play an MP3… (sarcasm, to be fair setting the target made no difference with the sound issue in 5.x btw.)

Using cocos2d-x 2.2.6 for what it’s worth.

Anyone have any other solution to try that doesn’t reek of black magic?