Android 4.0.4 bug on resume

After checking on numerous threads discussing bugs with the previous openGL implementation on Android, I have yet to see the problem which I am experiencing. Getting Android to restore cleanly to the previous state was difficult in itself and necessitated removing all storyboard scenes, manually resetting contentWidth and contentHeight, then rebuilding the current scene after a delay. Following those steps, most Android phones do restore properly; however, there is still an intermittent problem on Android 4.0.4.

When the app resumes from suspend, three potential scenarios occur:

  1. Everything loads fine (80% of time)
  2. The transparent regions of images go completely black (5%)
  3. Images are missing completely (15%)
    This happens with buttons, image sheets, straight PNGs, and sprites. --EDIT-- It happens every time a certain sequence of steps is followed so please see the follow-up post --END EDIT–

Using Corona build 2012.904
No problem on Droid running Android 2.2.3
No problem on Droid Incredible running Android 2.3.4
Major problem on Samsung Galaxy S3 running Android 4.0.4
Dynamic scaling with all original image sizes smaller than 1024px

Has anyone else experienced this type of bug? With the simplest of images (28x28px and 176x176px) in a test app, I’ve only been able to replicate case (3) where the image is missing on resume. The logcat output indicates 72% free memory as the app resumes. The only other thing that appears about that time is:

\<893\>: Android Image  
\<1088\>: RGB\_565  

If any of that helps someone else replicate or address this issue, it would be much appreciated. [import]uid: 168249 topic_id: 30928 reply_id: 330928[/import] 1088>893>

I will be interested to hear your findings.
[import]uid: 13784 topic_id: 30928 reply_id: 123760[/import]

I will be interested to hear your findings.
[import]uid: 13784 topic_id: 30928 reply_id: 123760[/import]

It turns out the problem is not actually intermittent, I just hadn’t discovered the exact procedure of events to cause it. It happens even with the simplest of apps. For example, the following code is set up to run in landscapeRight and will cause the problem every time.

[lua]local function main()
local image = display.newImageRect(“play.png”, 70, 86)
image.x, image.y = display.contentCenterX, display.contentCenterY
end
main()[/lua]

To reproduce the problem, try the following:

  1. Load the app and observe your glorious image
  2. Press the power key (not home) to turn screen off
  3. Press power again to turn screen on
  4. Without unlocking the screen, press power again to turn off
  5. Press power again to turn screen on
  6. Unlock screen and wonder where your image went

This has been submitted in a bug report (#17385) that hasn’t shown up yet in the bug tracker. The alpha problem happens on a full scale app when following the exact same steps above on a Galaxy S3. If anyone else can duplicate this issue, that could be very helpful. [import]uid: 168249 topic_id: 30928 reply_id: 124356[/import]

It turns out the problem is not actually intermittent, I just hadn’t discovered the exact procedure of events to cause it. It happens even with the simplest of apps. For example, the following code is set up to run in landscapeRight and will cause the problem every time.

[lua]local function main()
local image = display.newImageRect(“play.png”, 70, 86)
image.x, image.y = display.contentCenterX, display.contentCenterY
end
main()[/lua]

To reproduce the problem, try the following:

  1. Load the app and observe your glorious image
  2. Press the power key (not home) to turn screen off
  3. Press power again to turn screen on
  4. Without unlocking the screen, press power again to turn off
  5. Press power again to turn screen on
  6. Unlock screen and wonder where your image went

This has been submitted in a bug report (#17385) that hasn’t shown up yet in the bug tracker. The alpha problem happens on a full scale app when following the exact same steps above on a Galaxy S3. If anyone else can duplicate this issue, that could be very helpful. [import]uid: 168249 topic_id: 30928 reply_id: 124356[/import]

Everyone,

We’ve discovered that this bug on only occurs on Android 4.0 devices. It does not occur on Android 2.x, 3.x, or 4.1 devices. I proved it by reproducing this bug on a Galaxy Nexus that was running 4.0.2, then updated the OS to 4.1 and the bug would no longer occur. So, it sounds like Google fixed this issue.

But that said, we’ve found a work-around to prevent this issue from happening on Android 4.0 devices. This work-around will be made available in daily build #920, tomorrow. If you can confirm that this build fixes this problem for you then that would be great. Thanks! [import]uid: 32256 topic_id: 30928 reply_id: 124778[/import]

Thanks for addressing the issue Josh. It has been fixed for me in build #921. Thanks again for the timely fix. [import]uid: 168249 topic_id: 30928 reply_id: 125070[/import]

Everyone,

We’ve discovered that this bug on only occurs on Android 4.0 devices. It does not occur on Android 2.x, 3.x, or 4.1 devices. I proved it by reproducing this bug on a Galaxy Nexus that was running 4.0.2, then updated the OS to 4.1 and the bug would no longer occur. So, it sounds like Google fixed this issue.

But that said, we’ve found a work-around to prevent this issue from happening on Android 4.0 devices. This work-around will be made available in daily build #920, tomorrow. If you can confirm that this build fixes this problem for you then that would be great. Thanks! [import]uid: 32256 topic_id: 30928 reply_id: 124778[/import]

Thanks for addressing the issue Josh. It has been fixed for me in build #921. Thanks again for the timely fix. [import]uid: 168249 topic_id: 30928 reply_id: 125070[/import]