Highlighted

Android <= API 19 Multidex Slow Launch Issue

Community Beginner ,
Sep 18, 2018

Copy link to clipboard

Copied

What I'm seeing: I am running an Adobe AIR/Starling game that's using quite a few ANEs (Google Play Service, Google Games, Game Center, Facebook, Firebase, MoPub, etc). The method count is well past 64k so the apk ends up with 4 dex files meaning that I have to enable the reflection based dex loading on Android API <= 19. When I launch on such a device I get 20+ seconds of black screen until Adobe AIR finally loads and puts something on screen. I understand that this is clearly being caused by the slow unpacking of the dex files but atm I can't do much about that method count. I've been trying to get this black screen replaced with some kinda of loading screen even just a prolonged splash image but to no avail. I'll run through what I've tried...

1. I began by following this thread: AIR Native Extension Tutorials by airnativeextensions

Here we are adjusting the theme settings attached to the root AppEntry activity. This works fine but the result is that I get my new splash screen for about 2-4 seconds and then it still jumps over to the black screen until AIR starts up. No dice.

2. Next I followed this swf preloading concept: GitHub - joshtynjala/starling-preloader: An example preloader for Starling Framework running in Adob...

Perhaps my swf was taking ages to load so I offloaded the majority of the swf loading to the second frame of a core movie clip and instead immediately drew a background color and logo using native flash graphics on the first frame. This worked fine but didn't prevent the black screen. It took just as long for AIR to start up.

3. I decided to try looking at what was happening on the device during this black screen. Using "adb shell dumpsys window windows" I took a peek at what was actually being rendered to the window to discover that, on initial launch (when I see my splash screen) there is in fact an instance of .AppEntry being rendered, but when the 20+ second black screen appears there is no longer anything attached to the window. Then once AIR starts, .AppEntry is once again listed. Why is AppEntry getting removed from the window while we are unpacking the dex files? Without the ability to integrated into AppEntry's onCreate I can't figure out any way to cover up this 20+ second long black screen. This is a huge issue, no one launching an app is going to appreciate staring at a black screen for 20+ seconds.

I've tried playing around with the idea of launching some kinda splash activity but with how we are not allowed to set properties on the Main Launcher activity in an AIR application that doesn't even seem possible.

Also I've noticed that the 4 dex files in my resulting apk seem oddly used. Dex 4 appears full up to the 64k mark, dex 3 is about half way there, but dex 2, and 1 both have only around 1k. I'm not very familiar with Android but this seems odd to me. It appears that my app needs 2 dex files, so why is it using 4?

I've tried all the recent AIR builds and am currently using AIR 31. Happy to provide any other details!

Does anyone have any thoughts or ideas? Am I missing something?

TOPICS
Development

Views

300

Likes

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

Android <= API 19 Multidex Slow Launch Issue

Community Beginner ,
Sep 18, 2018

Copy link to clipboard

Copied

What I'm seeing: I am running an Adobe AIR/Starling game that's using quite a few ANEs (Google Play Service, Google Games, Game Center, Facebook, Firebase, MoPub, etc). The method count is well past 64k so the apk ends up with 4 dex files meaning that I have to enable the reflection based dex loading on Android API <= 19. When I launch on such a device I get 20+ seconds of black screen until Adobe AIR finally loads and puts something on screen. I understand that this is clearly being caused by the slow unpacking of the dex files but atm I can't do much about that method count. I've been trying to get this black screen replaced with some kinda of loading screen even just a prolonged splash image but to no avail. I'll run through what I've tried...

1. I began by following this thread: AIR Native Extension Tutorials by airnativeextensions

Here we are adjusting the theme settings attached to the root AppEntry activity. This works fine but the result is that I get my new splash screen for about 2-4 seconds and then it still jumps over to the black screen until AIR starts up. No dice.

2. Next I followed this swf preloading concept: GitHub - joshtynjala/starling-preloader: An example preloader for Starling Framework running in Adob...

Perhaps my swf was taking ages to load so I offloaded the majority of the swf loading to the second frame of a core movie clip and instead immediately drew a background color and logo using native flash graphics on the first frame. This worked fine but didn't prevent the black screen. It took just as long for AIR to start up.

3. I decided to try looking at what was happening on the device during this black screen. Using "adb shell dumpsys window windows" I took a peek at what was actually being rendered to the window to discover that, on initial launch (when I see my splash screen) there is in fact an instance of .AppEntry being rendered, but when the 20+ second black screen appears there is no longer anything attached to the window. Then once AIR starts, .AppEntry is once again listed. Why is AppEntry getting removed from the window while we are unpacking the dex files? Without the ability to integrated into AppEntry's onCreate I can't figure out any way to cover up this 20+ second long black screen. This is a huge issue, no one launching an app is going to appreciate staring at a black screen for 20+ seconds.

I've tried playing around with the idea of launching some kinda splash activity but with how we are not allowed to set properties on the Main Launcher activity in an AIR application that doesn't even seem possible.

Also I've noticed that the 4 dex files in my resulting apk seem oddly used. Dex 4 appears full up to the 64k mark, dex 3 is about half way there, but dex 2, and 1 both have only around 1k. I'm not very familiar with Android but this seems odd to me. It appears that my app needs 2 dex files, so why is it using 4?

I've tried all the recent AIR builds and am currently using AIR 31. Happy to provide any other details!

Does anyone have any thoughts or ideas? Am I missing something?

TOPICS
Development

Views

301

Likes

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
Sep 18, 2018 0
Explorer ,
Nov 12, 2018

Copy link to clipboard

Copied

are you using distriqt anes ? we have same issues and i guess removing initial adobe content is something done from one of this anes.

Likes

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
Reply
Loading...
Nov 12, 2018 0