• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Reporting: Adobe Air - Black Screen Bug Spotted

Community Beginner ,
May 10, 2014 May 10, 2014

Copy link to clipboard

Copied

Basically, my latest android app got rejected during a certification process due to a black screen popping up after triggering the alarm.

This is my error report that I received from the store:

Black screen appears after alarm

<Procedure>
1. Launch application
2. 'Start' > Play game > Alarm show up > End alarm > Check

<Expected Result>
Black screen should not appear

So all you have to do is create a new android project in air with nothing but a white background, set the orientation to horizontal, check the full screen option, export and install the app, run the app, minimize the app and open the clock app and set an alarm, go back to the app, wait for the alarm, then cancel the alarm once it pops up, and what you get is a black screen.


Interestinly enough, the background music plays in the background, admob ads work as well, only the screen goes black, but once we minimize the app and then go back to it again, everything's fine. Moreover, when the app is in a vertical mode, the black screen doesn't appear.


Additional info: Apps developed in Flash Professional with the use of Air 4.0. Tested on android 4.3 & 4.4.

Unfortunately, I won't be able to upload android air apps until the problem gets fixed .

TOPICS
Development

Views

2.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 10, 2014 May 10, 2014

I take it this is the Samsung store? They rejected an app I submitted for the same reason.

The issue is caused because the Android alarm alert clears out the GPU texture memory, and AIR doesn’t have any way to know that has happened. You can work around the issue by forcing textures to reload. An easy way to do that is to set the stage quality. Here’s how that would look:

stage.addEventListener(Event.ACTIVATE, fl_Activate);

stage.addEventListener(Event.DEACTIVATE, fl_Deactivate);

private function fl

...

Votes

Translate

Translate
LEGEND ,
May 10, 2014 May 10, 2014

Copy link to clipboard

Copied

I take it this is the Samsung store? They rejected an app I submitted for the same reason.

The issue is caused because the Android alarm alert clears out the GPU texture memory, and AIR doesn’t have any way to know that has happened. You can work around the issue by forcing textures to reload. An easy way to do that is to set the stage quality. Here’s how that would look:

stage.addEventListener(Event.ACTIVATE, fl_Activate);

stage.addEventListener(Event.DEACTIVATE, fl_Deactivate);

private function fl_Activate(event:Event=null):void {

stage.quality = "low";

}

private function fl_Deactivate(event:Event):void {

stage.quality = "medium”;

}

For our apps we use the stage quality of “low”, which uses less memory, and when the app is deactivated the quality is switched to “medium”, then back to “low” when activated again.

That’s enough to make the textures reload.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 10, 2014 May 10, 2014

Copy link to clipboard

Copied

Yes, it's the samsung store. Anyway, thanks for the workaround. Tested the app and it works flawflessly

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 09, 2014 Sep 09, 2014

Copy link to clipboard

Copied

I tried this fix and still getting issues reporting on Samsung devices.  I am using GPU rendermode and not really sure how to fix this.  I have an admob interstitial on startup and feel like that is what is causing the issue but I haven't been able to reproduce myself.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 09, 2014 Sep 09, 2014

Copy link to clipboard

Copied

It may well only be GPU mode that shows the problem, though I could imagine Stage3D in Direct mode would do the same. The general case is that when the AIR app goes into the background and then comes back, the GPU textures may have been wiped out by the system. If you do really go to the background, as would be the case when an alarm dialog appears, you'll get the deactivate event that you can use to know that it has happened, and you can set the stage quality on the activate event.

In the case of the ads it may not count as being a full deactivate, but there is bound to be an event from the ad ANE. Look in its documentation for what evens happen when the ad is closed, and apply the stage quality work around to that event.

There is a chance that you won't have got the deactivate event, to set the quality to something different, and then when the activate event tries to change the quality nothing happens. At least I'm thinking that may be the case. You could work around that by testing if the quality is the one you want, then go away from that and back again to force a reload. For example, if you want the quality to be "medium" while the app is running, you could do this in the activate event, to make sure that it went away from medium:

if(stage.quality == "medium")  stage.quality = "low";

stage.quality = "medium";

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 09, 2014 Sep 09, 2014

Copy link to clipboard

Copied

I have tested the interstitial and do get those events but maybe different devices behave differently so maybe I will also try to toggle when the ad is dismissed.  I havent been able to reproduce on any test devices so not sure how to resolve, I just get reviews in google play that say it is blank.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 11, 2014 Sep 11, 2014

Copy link to clipboard

Copied

LATEST

Colin is a genius.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines