APK deployed on device crashes with black screen

Hey everyone, I’m having an issue with deploying my .APK to android devices and emulators. I’ve looked at several ways on here to resolve the problem but nothing has worked so far.

So what happens is, my apk’s will build just fine in development and distribution (signing works okay now).

When i deploy the apk either through the batch file or manually installing to a device, I am greeted with the UE4 placeholder splash screen. It then goes black after a few seconds and then crashes to the devices desktop.

There are no error messages either (I might have to include debug files to get those?)

I’ve also got the same question on StackOverflow here

There are several posts like this which I have commented on but I don’t think the community staff that marked the previous posts as answered are active as I’ve had no response.

EDIT: I’ve updated to 4.17 and I’m still having the same issue.

Try to filter your log with UE4|Debug please. There is a green plus to the left of Logcat in Android Device Monitor, create the filter on your package name and those tags.

The map you are mentioning - are you failing on Assertion Failed blah blah in Map.h ?

I don’t believe to be failing on “Assertion Failed”, however I have filtered my LogCat for debug messages.

It’s a lot shorter than the previous! (Thanks for the filters tip, never used logcat before or Device Monitor, it’s a new area for me!)

ADB LogCat DEBUG Filter Logcat Filter - DEBUG - Pastebin.com

ADB LogCat Package name only filter logcat package name only filter - Pastebin.com

10-31 10:10:23.828: I/DEBUG(1518): pid: 3514, tid: 3615, pkg name: com.derpstudios.HollyblueHolistics
10-31 10:10:23.828: I/DEBUG(1518): pid: 3514, tid: 3615, name: main  >>> com.derpstudios.HollyblueHolistics <<<
10-31 10:10:23.948: I/DEBUG(1518):     #05  pc 01b42403  /data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so (UEnumProperty::SerializeItem(FArchive&, void*, void const*) const+215)
10-31 10:10:23.948: I/DEBUG(1518):     #09  pc 01b42403  /data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so (UEnumProperty::SerializeItem(FArchive&, void*, void const*) const+215)
10-31 10:10:23.948: I/DEBUG(1518):          89606b90  05b43980  /data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so (UEnumProperty::ConvertFromType(FPropertyTag const&, FArchive&, unsigned char*, UStruct*, bool&)+44)
10-31 10:10:23.948: I/DEBUG(1518):          89606bc0  0598b280  /data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so (TTextData<FTextHistory_Base>::GetTextHistory() const)

The above code block is with me searching for package name with the debug tag

  1. “derpstudios” - lol you r awesome!
  2. I am kind of unable to see any issue in the logcat you posted (correct me if i am wrong, maybe i am missing).
  3. Pls do next: open cmd/shell console/ whatever you have on your machine, type “adb devicves”. It will tell you your device id. If not - woalah your device is not connected. If yes, type next: “adb -s YourDeviceIdFromPreviousLine logcat > SomeFolderAddress/somefoldername.txt” . Type enter. It started to record your logcat. ONLY THEN try to start your application on-device. Wait for it to crush. Ctrl+break the cmd/shell window you were writing those adb commands to. Post here the link to the logcat.

I can’t promise miracles, but i’ll try my best at least to appoint you what generally goes wrong.

Aww thanks! I’ll get on that now and post up whatever I can find!

Here’s what it pulled up!

Logcat via Command line (FilAl) https://pastebin.com/P31Hw5Ya

Easy peasy lemon squeasy!

Your issue is here:
Line 7333 of your log:
F/libc ( 3784): Fatal signal 11 (SIGSEGV) at 0x00000005 (code=1), thread 3899 (main)

I/DEBUG ( 1518): pid: 3784, tid: 3899, pkg name: com.derpstudios.HollyblueHolistics

/data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so (UEnumProperty::SerializeItem(FArchive&, void*, void const*) const+215)

/data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so (UEnumProperty::SerializeItem(FArchive&, void*, void const*) const+215)

/data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so (UEnumProperty::ConvertFromType(FPropertyTag const&, FArchive&, unsigned char*, UStruct*, bool&)+44)

/data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so (FTextHistory::IsOutOfDate() const)

You have some Serialization/deserialization issues with one of your UEnums as far as i can see.

Just read carefully from 7333 to 7435

Thanks for this! So it’s struggling to serialize an enum. Now I’ve just gotta find out why it’s struggling. My current build of the engine is 4.16. Do you reckon if I update it to 4.17 the issue will resolve?

It appears to be coming from libUE4.so? Is that the file which is struggling to get its enums serialized?

Sorry for all the questions, the Android side of things is still a little overwhelming for me haha

EDIT: I’ve checked the enums in my project and apart from the standard ones in UE4, I haven’t created any new ones. The only ones used are toggle visibility ones that are in UMG and another which is used in one of the blueprint nodes within a plugin.

EDIT 2: Changing engine version didn’t work either (4.18 is throwing even more errors haha)

Hey Kagamusha,

Can you try add your maps to Project Settings > Packaging > List of maps to include in a package build.

I’ve got it listed on there but it hasn’t made a difference unfortunately!

Sorry for the late updates, i just work too much hours.

Dude, what’s your NDK version? Seems ALOT like NDK version issue. You see, UE Build Automation is not smart enough to work with latest NDK. You need r14b at most. Downgrade if you are above. Also your SDK build-tools should be 25.0.1 at most. Downgrade.

Generally, if it’s not some of your own, proprietary code that is problematic, then it’s NDK and SDK build-tools version.

It’s okay buddy! I was away this weekend myself in all fairness!

I don’t think it’s any of my actual code or blueprints so it might well be an NDK or SDK issue.

My NDK Version is: r12b (Should I update this one to r14b?)
My SDK version is: 25.0.3 (this might be the problem? I’m using IR6u1 as suggested by the documentation, do i just need to use ir6? That’s the only way i can downgrade my sdk version, but it will downgrade to 24.x.x)

I tried downgrading to build tools 24.0.1 and it won’t build, so i’ll go back to 25.0.3

Upgrade your NDK to r14b, yes.

Downgrade build tools exactly to 25.0.1 pls. I didn’t stumble upon API difference in compiling Unreal Engine side things. I can not ttestify for 24.0.*

I downgraded my SDK and upgraded my NDK and I’m still having the same “crash to desktop” issue :confused:

Want me to produce anymore logs?

I’m so confused at why this isn’t working, I bet the fix for it is simple too and it’s just not being shown by the editor lol

Yes please. Try to produce more logs. I hope that the issue changed. If not, i am being out of options, but let’s first see the logs.

Here is my latest logcat with the downgraded SDK build tools and the upodated NDK as we discussed earlier :slight_smile:

Latest Logcat https://pastebin.com/2qjqUjqD

AppName HugsRoom lol!!!


E/dalvikvm( 4616): dlopen("/data/app-lib/com.derpstudios.HollyblueHolistics-1/libOVRPlugin.so") failed: dlopen failed: “/data/app-lib/com.derpstudios.HollyblueHolistics-1/libOVRPlugin.so” has unexpected e_machine: 40

D/UE4 ( 4616): OVRPlugin library not loaded and required!

at 7875-7876

And then:

D/houdini ( 4616): [4616] Open Native Library /data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so failed.

E/dalvikvm( 4616): dlopen("/data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so") failed: dlopen failed: "/data/app-lib/com.derpstudios.HollyblueHolistics-1/libUE4.so" has unexpected e_machine: 40

W/dalvikvm( 4616): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/epicgames/ue4/GameActivity;

W/dalvikvm( 4616): Class init failed in newInstance call (Lcom/epicgames/ue4/GameActivity;)

D/AndroidRuntime( 4616): Shutting down VM

at line 7897 and forth. There is a regular crush sequence after that.

Good news - we have progress. It’s a different error now.

Bad news - i have no clue what is e_machine: 40 . When you will figure this out, please post here.

Okay! I have some great news!

I’ve removed the OSVR and SteamVR plugins from the project (they aren’t needed). I also unticked the packaging options for them on the android settings and the app now DOESN’T crash on startup!

I’m left with some UMG stuff to sort out (but that’s something else haha) but the app works!

Thank you so much FilAl, you’ve been VERY helpful and very patient. I can’t thank you enough for helping me through this! :slight_smile: You’re a legend :smiley:

I found a solution here: Android app failed with error: library libGLESv3.so not found - Mobile - Unreal Engine Forums

When i use the Android Device Monitor from the SDK, this is the log that it shows when running the crashing apk.

Android Device Monitor: https://pastebin.com/C4LrPd92

ADB LogCat https://pastebin.com/6NKakYTG

ADB LogCat DEBUG filter Logcat Filter - DEBUG - Pastebin.com

ADB LogCat Package name only filter logcat package name only filter - Pastebin.com

Has anyone managed to resolve this and can anyone tell me what this log is saying?

EDIT: I’ve tested a blank map with and without the plugin active, so it’s something else!