cancel
Showing results for 
Search instead for 
Did you mean: 

removing android.permission.READ_EXTERNAL_STORAGE results in black screen on apk build

jaemoonc
Explorer

Hi!

I am having issues submitting my games on App Lap.

When I tried to execute my game on the quest2, it shows nothing but black screen after splash screen.
(It's different than a 'three dots' problem we have discussed previously)

And here are the details.

I had to remove android permissions as the oculus dashboard says, so I have followed the instructions of @lee17  in the following link.
https://forums.oculusvr.com/t5/Unreal-VR-Development/Quest-releasing-problem-android-manifest/td-p/8...

It successfully removed sensitive permissions and looked ready to submit, but this was a point where this problem came out.

I dug further into AndroidSanitizePermissions_UPL.xml, commented out line by line.
<removePermission android:name="android.permission.READ_EXTERNAL_STORAGE" />
when I commented out this line, the problem is gone. that means my apk requires it somewhere.

So tried to narrow this problem further, by checking whether this problem specific to my project or universal. conducted following test.
- In UE4.26.2, started from VR Template followed instructions in https://developer.oculus.com/documentation/unreal/unreal-quick-start-guide-quest/
(It's a clean project without any plugin enabled)
- on apk Packaging - extra tags for <application> node >> allowBackup="False"
- on ExtraSettings for <application> section >> android:networkSecurityConfig="@xml/network_sec_config"
- then followed @lee17 instruction again in https://forums.oculusvr.com/t5/Unreal-VR-Development/Quest-releasing-problem-android-manifest/td-p/8...
and the problem is reproduced.

1. If there a better way to clean android permission, let me know please.
2. Any other solutions?

Your help would be much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

jaemoonc
Explorer
I think I have found a solution to this problem.
I have separated my Map into multiple chunks, then loaded it in runtime sequentially, then built a (singleton)reference to the object.
In this way, I was able to solve the problem effectively. No more black screen in shipping build!
thank you all.

View solution in original post

7 REPLIES 7

pro_zac
Heroic Explorer

I have some experience with these permissions, so I'll try to help. I'm working on an AppLab release using UE4.27 right now, and I was able to remove the manifest permissions and run my app as expected.

 

Make sure to build out the apk and install it with the batch file. Don't use the "launch" button in the editor.

 

I created the xml file and updated the .Build.cs as shown in the instructions you are following. However, I'm not using a ManifestRequirementsOverride.txt. Maybe try without that. I see no good reason that should make a difference, but it's working for me.

jaemoonc
Explorer

Hi, I had no luck trying your solution, due to the following reasons.

 

- I can't use UE4.27, due to project-specific reason.

- Tried your solution without ManifestRequirementsOverride.txt on UE4.26, but it didn't work.


thanks for your time , 🙂

Don't worry about using 4.27. You should be able to get this working with 4.26. Worst case, you ask for an exception from the review team as noted in the other thread.

 

Out of curiosity I built one of my 4.26 projects and took a look at the manifest. I packaged a shipping build with "for distribution" enabled and signed with a keystore. When I inspect the android manifest in <Project>/Intermediate/Android, I see that it includes "android.permission.WRITE_EXTERNAL_STORAGE" but not "android.permission.READ_EXTERNAL_STORAGE".

 

Is it possible you are trying to remove the read permission but it wasn't included to begin with? This may only be relevant to your VR template project.

jaemoonc
Explorer
I would like to share my progress regarding this issue.
First I apologize I had a misconception about the problem, It turns out `android.permission.READ_EXTERNAL_STORAGE` was less relevant to this problem.
I found some cases showing black screens even with that permission.

A better description for this problem was, my shipping build apk behaves very indeterministic. meaning sometimes it runs fine, sometimes it shows black screen. (I found it was really hard to specify which one caused the problem)
Symptoms are somewhat similar to the following Link

I'm thinking of using Development Build as a workaround for this problem.(It's working great!) and the dashboard says nothing about using it.

Thank you @pro_zac .

jaemoonc
Explorer

(I have deleted message due to duplicate of previous one)

pro_zac
Heroic Explorer

Can you share a log file from the app hanging at the black screen on startup?

adb pull /sdcard/UE4Game/ProjectName/ProjectName/Saved/Logs/ProjectName.log

jaemoonc
Explorer
I think I have found a solution to this problem.
I have separated my Map into multiple chunks, then loaded it in runtime sequentially, then built a (singleton)reference to the object.
In this way, I was able to solve the problem effectively. No more black screen in shipping build!
thank you all.