Android C++ project black screen when packaged for shipping

Hello,

When packaging a game for android with the shipping build configuration and for distribution ticked, the app (Whether loaded from a bat file or from the store directly) will always show a non-interactive black screen if launched for a second time onwards. The first time the game is launched the OBB verifier will run and the game will almost always launch as normal (I say almost, as there is a rare chance of it crashing or black screening here too), but any subsequent time will always result in a black screen with the only confirmed solution to be reinstalling the app. Disabling the OBB verifier causing the black screen to happen on first startup as well, although from the look of logcat the verifier is still packaged with the game, just not run.

This has been tested on an LG G3 and G2, and while killing a Google Play Service instance on the G2 appears to have allowed subsequent running of the game in one instance, this could not be replicated on the G3 or later on on the G2. This black screen also occurs regardless of whether Google Play services are actually enabled in the game or not (And the Google Play logon popup will not display on subsequent launches either). When the black screen happens, I do notice that the back button rotates to landscape, but no further progress is made after that.

Logcat doesn’t seem to provide any much useful data aside from the suspicious lines below (The actual package name has been replaced):

E/Vold    (  280): Failed to find mounted volume for /storage/external_SD/Android/obb/uk.co.game/  
W/Vold    (  280): Returning OperationFailed - no handler for errno 0  
W/ContextImpl(14653): Failed to ensure directory: /storage/external_SD/Android/obb/uk.co.game

(The lines above repeat a few times)

E/sudhakar( 1033): PackageName = uk.co.game

(I couldn’t find any details about ‘sudhakar’ and there are no references to it when other apps launch, although this line is an error. Could this be an issue with not starting with ‘com.’?)

W/ActivityManager( 1033): Activity destroy timeout for ActivityRecord{13e1e235 u0 uk.co.game/.DownloaderActivity t4393 f}

(This is the last reference to the app until details about the user closing it)

Any potential insight into the cause would be greatly appreciated as reinstalling the app every time it needs to be run is proving a massive pain for our alpha testers.

Thanks,

Hi danm36,

Are you running binary from the launcher or source from Github? Can you include your successful build output logs and the entirety of the logcat logs to this thread as txt file?

Did you see this issue prior to the 4.8 release? If this is an issue new to the release, here’s something to try:

In the Engine folder, delete the DDC
(Derived Data Cache). In your project,
delete the Intermediate, the Saved,
and the Binary folders.

When you next try to package it will take considerably longer as the shaders will need to newly compile, but this should get rid of any old or corrupted files that haven’t gotten deleted.

Thanks!

Hi danm36,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

Sorry for the late response, I was out of the country for a while and didn’t have access to the internet.

I updated to 4.8.1 today, but no progress in this front sadly. A clear of the DCC and Intermediate, Saved and Binaries folders didn’t help either.

Attached are the build and logcat outputs on 4.8.1.

One thing to note is that my OBB file is around 214MB large and each time I package the game (So long as the content is changed in some way), the resulting OBB seems to be semi-randomly missing different content elements, even missing out content defined in the CDO (There is dynamically loaded content too, and I can understand why that could be missing - I am currently working on a system to work around these large pieces of content, hopefully massively reducing the size of the OBB).

Aside from the missing elements, which tend to be music tracks or - in rare cases - fonts, the game runs fine during the first run where the OBB/download checker runs, but never afterwards. Could it be that this ‘fractured’ OBB file is causing issues or a bug that is avoided when the downloader activity is run? I’m going to remove a bulk of the content and see - once I get the OBB size below this apparent limit - if the game runs fine.

Update

With only the main menu music and one other track packaged, the OBB has been reduced to 64mb. I am not presented with a CDO error this time round, but at the same time the tracks still wont play. The non-uasset data that is loaded with the tracks appears to be packaged fine. These uasset audio files are loaded dynamically into an audio component, and work fine when launched directly from editor onto the device.

With regards to the primary problem (As I have a potential workaround for this music issue), reducing the OBB size does not prevent the black screen from appearing on subsequent runs. The onscreen buttons rotate to landscape after a few seconds, but no further activity occurs and the game must be quit by the recent apps switcher

Hi danm36,

Are you still seeing this across all your tested devices? I’m still seeing

E/Vold ( 280): Failed to find
mounted volume for
/storage/external_SD/Android/obb/uk.co.danm36.ue4androidgame/

This is not a UE4 specific error. Here is some info about Android and internal storage and sd card.

As to your audio problems, in the logs I see some references to issues with AudioFlinger, here is some documenation to debugging that.

I also see a Permission Denial: broadcasting Intent error involving what appears to be Facebook (

Permission Denial: broadcasting Intent
{
act=android.net.conn.CONNECTIVITY_CHANGE
flg=0x4000010 (has extras) } from null
(pid=-1, uid=-1) requires
com.facebook.permission.prod.FB_APP_COMMUNICATION
due to registered receiver
BroadcastFilter{2dccef44 u0
ReceiverList{e197857 14896
com.facebook.katana:dash/10147/u0
remote:6dafdd6}}

)

That might be something to look into if your app is needing FB integration to work.

Once again, sorry for the late update. Upon further tests, it looks like the issue was a slightly broken transition from 4.6 to 4.8. While I don’t explicitly know what was wrong, creating new demo projects and packaging them for shipping worked fine, and at the current stage of moving content to the new project, everything seems fine. If something does flag up as we convert, I’ll immediately bring this to your attention, otherwise this problem is solved.

Thank you for your time,

Sounds just like this problem that I am having: [UE4.8] Android with OBB black screen on Potrait - Mobile - Unreal Engine Forums