Game Fails on APK Launch, But Not Editor Launch

I’ve encountered such a strange problem. I went to package my game for android and even pushed it to release on google play. The game testing that takes place for stability shows videos of my game running, but when you install it and try to run it, you just get a splash-screen and then a gradient background, and it just hangs there. It launches when I plug in my phone and launch from the editor. But if I package and copy the .apk to my phone to install it, I just get the black and white gradient screen. Does anyone know what might be causing this? Thanks in advance.

Log from standalone launch

Log from editor build and launch

Thank you so much to anyone willing to make sense of these logs. I am very confused about why my game is failing. It is crucial I get this figured out.

In your project settings do you have the correct game default map?

Thanks for responding to my question, but I do have a default map selected. Any other ideas would be very appreciated.

I will reply with an edited reply soon. I need a minute to figure out how to use the andoid device monitor. Thank you so much for helping me.

Logs have been added to the main question.

Body sensor? Your app says it needs this permission:

android.permission.BODY_SENSORS

Try adding this permission and let’s see what will happen.

Also I didn’t understand what second log is. I need logs from development APK. It must be created in your games save directory. You need to find your apps save directory first, then you can easily find Logs folder there.

Sorry android.permission.BODY_SENSORS, not android.permission.BODY_SENSOR. I edited my comment.

How exactly do I add a permission? Do I need to modify the AndroidManifest.xml file to do that, or is there an option in the editor?

Since posting this question, I’ve a done a few things that may help troubleshooting. I made a brand new project with no starter content, just the little block that spawns by default, and the base objects. So I tried to package it, and it failed and told me gradle failed in the log. So I told the new app to use ant instead of gradle and the packaging completed.

The new project won’t launch to my phone from the editor, but the the packaged apk will launch, however, to just a black background with only the touch controller-sticks on top. I am inclined to think it is a problem with codeworks because of this. We are supposed to be using r16 still, aren’t we? That’s what says in the ue4 documentation.

I will update my original post, but I’m unsure what I did wrong about the log. Before updating my log, I want to ask a specific question → I got it from the C:.…\game\saved\logs folder. I first deleted it, then did the build on the apk, generating a new log file. Should I launch the game to my phone from the editor, where it actually works, and give you logs for that? I just want to certain I give you what you need to help me.

  1. Just search ‘permission’ in project settings
  2. Moving partial project files always cause problems, so normal. I don’t think it is a problem of nvpack version. Sdk version is what matters.
  3. Saved/Logs folder also exists in your phone storage when you launch with development mode APK. Try these: applications - Where do Android apps store data? - Android Enthusiasts Stack Exchange

Oh you launched in Android device from editor? Sorry these logs are enough. I will check them.

Please investigate this errors:

LogPlayerController: Error: InputMode:UIOnly - Attempting to focus Non-Focusable widget SObjectWidget [Widget.cpp(710)]!

Is LogPlayerController your class? Check what is problem of it from Widget:719. I am mobile now so cannot do many thing. Ç

YOU ARE THE BEST!!! Thank you thank you thank you so much! This was driving me crazy. All I had to do was add that permission. Did I say thank you? Because I really appreciate it!

I will grant you the answer however you want to write it by the way. If you write something down there, I’ll accept it.

First things to do are investigating logs. Please share these logs:

  1. Package the game in development mode, launch and find Logs folder.

  2. Launch monitor.bat in NVPACK, select your device, clear logs and immediately launch the APK. And when you see gradient screen, immediately copy logs with Ctrl+A & Ctrl+C.

Good, I am happy to see you resolved your issue :slight_smile: But I wonder why your app does need sensor permission? Looks like you were not aware of a sensor feature in your app.

Also to resolve this kind of Android issues, first thing I do is searching keyword: ‘permission’ in monitor.bat logs according to my past experiences. So it was very easy for me :slight_smile:

I don’t think so. I wouldn’t know exactly where to find that. I mean, I use “get player controller” all the time. But I’m not sure what logPlayerController is. Thank you for continuing to help me figure out the cause of this.

Hey again Balkan. I noticed another anomaly. When I change back to shipping, we have the same issues as before. It’s as if it needs this permission to access phone internals to render my main subject. It’s quite odd. I’ve gone so far as to reinstall windows, ue4, visual studio, and codeworks, and I have the exact same problems, even with a brand new project, gradle fails. I would appreciate it if you could offer some insight, as you seem very knowledgeable, and many questions go unanswered here.

I can work around it for now, but not being able to to put my app in “shipping” adds a massive 40% to my file-size. At some point, I will need to be able to package an .apk properly, and I’m wondering what else can I try???

By the way, when I comment here, It removes your answer as the accepted answer, don’t worry, I’ll be sure you retain ownership of the answer; I just didn’t know how else to comment on this subject. Thanks so much for your time and help.

Did you take same permission error in monitor.bat logs? If so, probably BODY_SENSORS permission should be given at runtime. Android sees BODY_SENSORS permission in dangerous category:

Use “Request Android Permissions” node in blueprint if this is the problem and do the jobs that you do after(if) user grants BODY_SENSORS access.

I did take the same permissions. Thank you so much for your continued help. I haven’t had the chance to use this advice yet, but thank you nonetheless.

Hey , I know it’s been 2 weeks, but I’ve been swamped. Are you still willing/able to help me with my specific issue if I update my logs? Many of my testers are weary of allowing permissions like that. Not to mention I can’t get my shipping build working.

If so, I’ll update this question or make a new one, but let me know, and I’ll thumb up every post you make.