Oculus Quest Stereo Layer not working when cooked by the book

Hi there,

Stereo layer works on builds with cooked on the fly but not working builds with cooked by the book. To reproduce:

1- Open a VR Template Project on 4.23

2- Turn off SteamVR in plugins and deleted SteamVR related nodes in BP_MotionController

3- Make a BP wih Stereo Layer Component. Set it to World Locked. Use either a Texture or UMG (I provided a sample project with UMG too.)

4- Use these settings in Android Settings.

Android Package Name: com.YourCompany.Test
Application Display Name: TestTest
Minimum SDK: 23
Target SDK: 23
Install Location: Auto
Package Inside .apk?: True
Disable OBB: True
Enable Fullscreen...: True
Tried both OpenGL ES3.1 and Vulkan

Extra Tags for <manifest>:
android:name="android.hardware.vr.headtracking"
android:version="1"
android:required="true"

Extra Tags for <application>:
android:allowBackup="false"

Extra Settings for <activity>: 
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"

Extra Permissions:
android.permission.RECORD_AUDIO
android.permission.READ_EXTERNAL_STORAGE
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.MODIFY_AUDIO_SETTINGS
android.permission.INTERNET
android.permission.ACCESS_NETWORK_STATE

Add permission to support.....: True

Package for Oculus Mobile: Quest

Configure.....: 6.6

5- Connect Quest to PC

6- Project Launcher - Launch on Quest with defaults —> This is On the Fly cook.

7- After its completed, restart Quest and open TestTest in Unkown Sources —> Observe Stereo Layer working.

8- Project Launcher - Advanced (Top Right) - Launch on Quest with Dev and By the Book —> This is By the Book cook. Keep it Dev so we can reduce the possibility. Because you cant use On the Fly with Shipping.

9- After its completed, restart Quest and open TestTest in Unkown Sources —> Observe Stereo Layer not working.

Link to Sample Project. Just download, and repeat from step 5.

Edit: Obviously, you will need Android SDK and NDK set.

Edit2: So It might not be related to On the Fly and By the Book difference. I inspected the log for each Launch. Both include “Cook by the book total time in tick …”. So both might be Cook By the Book. After further inspection, I found some difference in Launch command arguments.

The one Launched from Editor(step 6): -build -skipcook -CookInEditor -iterativecooking -iterativedeploy -nocompile

The one Launched from Project Launcher(step 8): -cook -unversionedcookedcontent

Edit3: So all I want is to be able to pack it in pak and have the stereo layer work. I somehow found a workaround. I tried lots of possibiliies. Only thing worked is, adding -CookInEditor to command argument that I got from Project Launcher argument and used it with RunUAT.bat. Reminder, you shouldn’t use this line directly. This line includes arguments for my system and it wont work for you. Just add -CookInEditor to your line.

RunUAT -ScriptsForProject=D:/Unreal/Perforce/__Development/VR_4_23/VR_4_23.uproject BuildCookRun -project=D:/Unreal/Perforce/__Development/VR_4_23/VR_4_23.uproject -noP4 -clientconfig=Shipping -serverconfig=Shipping -nocompile -nocompileeditor -installed -ue4exe="D:\Program Files\Epic Games\UE_4.23\Engine\Binaries\Win64\UE4Editor-Cmd.exe" -utf8output -platform=Android -targetplatform=Android -cookflavor=ASTC -build -cook -map=MotionControllerMap+StartupMap+HMDLocomotionMap -CookInEditor -pak -createreleaseversion=1.0 -compressed -stage -deploy -cmdline="MotionControllerMap -Messaging" -stagingdirectory=D:/Packages/R1.0/Android/ -device=Android_ASTC@1PASH9A20K9276 -addcmdline="-SessionId=6B56FA404AC86F5973BE4896F47D508E -SessionOwner='Owner' -SessionName='Quest'  " -run