Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.82k stars 821 forks source link

Object not removed from Stage on Android - Starling maybe? #1095

Closed raresn closed 2 years ago

raresn commented 2 years ago

Hello, we recently found a bug in our app that we can't figure out. When we first start the app:

add a "splash screen" load the data from the device (load files) launch starling remove the "splash screen" Now, we encountered some scenarios where the removal of the "splash screen" doesn't work.

I am attaching the sample code to reproduce this.

SCENARIO 1 - WORKING -by setting skipUnchangedFrames to false, it will run the app, -it will show the splash -it will fake load for 5 seconds (just a while loop to simulate loading of files) -start starling -it will try to remove the splash after 3 seconds -it will work

SCENARIO 2 - NOT WORKING this is the case we encounter in our app, and why we built this simple test after nearly going insane ;))

-by setting skipUnchangedFrames to false, it will run the app, -it will show the splash -it will "fake load" for 5 seconds (just a while loop to simulate loading of files) -- we put the app in background when this "load" starts (so, not close, just put it background) -- we open it up again within these 5 seconds -start starling -it will try to remove the splash after 3 seconds -it will NOT WORK ANYMORE, nor show the blue background of Starling!

SCENARIO 3 - NOT WORKING -if you set skipUnchangedFrames to true, -it will show the splash -it will fake load for 5 seconds -start starling, -it will show the blue background of starling -it will try to remove the splash after 3 seconds, but will fail to do so.

Known fix - rotate the screen, or put the app in background and put it in forground again. Source files here: splashTest.zip

@PrimaryFeather do you have an idea what i can do here?

PrimaryFeather commented 2 years ago

Hey @raresn, sorry for the late reply β€” your report reached me while I was on a vacation.

I'll have a look at your sample and will try to reproduce the error. I'll get back to you as soon as I've got something to share.

Daniel

PrimaryFeather commented 2 years ago

I'm afraid I couldn't reproduce the problem over here, even though you created a really excellent sample.

Am I doing this correct? I'm debugging the app on Android, and move to the launcher as soon as I see the text "begin wait for 5 seconds". Then, before those 5 seconds are over, I switch back to the app (i.e. move it to the foreground), and wait for the red quad to disappear β€” which it shouldn't, according to your description, but does on my devices. 😐

I tried that on Android 11 and 6, using AIR 33.1.1.713. I also changed skipUnchangedFrames as described, but it didn't have any effect, either.

Which AIR version are you using? And could you maybe post your application.xml file?

raresn commented 2 years ago

I really can't understand - On android 9 debug version it doesn't work. Aab non debug works, and works in both debug and non debug on all newer android versions. I will try to build a better example once i can wrap my head around this :)

PrimaryFeather commented 2 years ago

Ah, damn, having something like this happen only on specific Android versions makes it really difficult to solve ... I'm feeling with you. πŸ˜• At least it's good to hear that it's the newer versions that run fine.

raresn commented 2 years ago

@PrimaryFeather just added a new one. Full days in the wonderland of bugs! Maybe you can check it out if you have time?