Screen flickering on Android

When I install my game app on Android device, app first screen visible with flickering, I cannot click buttons etc., this happens everytime when Play Protect popup promts.

If I minimize app and return back to it, flickering disappears

I removed stopAnimation() line on AppDelegate::applicationDidEnterBackground()
method and flickering gone but this is very problematic solution.

I guess whenener android popup appears on app cocos doesnt decide is it running on background or foreground and runs both applicationDidEnterBackground and applicationWillEnterForeground

I am using cocos2dx v4.0, Android device is Redmi note 9s

please help

1 Like

hi doexes, its’ hard to help out based on the information you have provided. You will have to debug the problem by disabling parts of your app and see which part introduces the fliker.

I encountered the same issue.
The screen is flickering when I use Google Play Game Service.
I’m using cocos2d-x v4.0 too.

How to reproduce.

  1. Open Google Play Game App and go to setting screen by touching the button on the top right of the screen.

  2. Go to “Change Game Account”

  3. Touch Change button, and logout from all games.

  4. Open Cocos2d-x App which using google play game service (I’m using com.google.android.gms:play-services-games-v2)

  5. The login prompt appears, then the screen start flickering.

As doxes said, If I remove “stopAnimation()” line on “AppDelegate::applicationDidEnterBackground()”, the flickering never occur.

This is my workaround to avoid this flickering.

Don’t call stopAnimation() in AppDelegate.cpp until the first play game service login prompt disappear.

I can get the status:firstSignInAttemptFinished like below.

・AppActivity.java onCreate

PlayGamesSdk.initialize(this);

mGamesSignInClient = PlayGames.getGamesSignInClient(this);
mGamesSignInClient.isAuthenticated().addOnCompleteListener(isAuthenticatedTask -> {

  firstSignInAttemptFinished = true;

});

It works, but I think this is not good idea.
If someone know the reason of flickering and can fix it, please let us know.

Thank you.

1 Like

Thank you i will try it, sdk or other google service popups cause this