From Licensee:
#In OpenXRHMDModule:473 (UE5.0) or OpenXRHMDModule:497 (UE5.1) the engine is checking if the app is packaged for Oculus Mobile, if it isn't the case the function returns false and the execution doesn't continue, and the result is a black screen issue in the device.
#if PLATFORM_ANDROID
// TODO: Allow OpenXR on non-Oculus Android platforms
if (AndroidThunkCpp_IsOculusMobileApplication())
{
UE_LOG(LogHMD, Log, TEXT("OpenXRHMDModule: App is packaged for Oculus Mobile"));
{quote}}
else
{{quote}
UE_LOG(LogHMD, Log, TEXT("OpenXRHMDModule: App is not packaged for Oculus Mobile"));
returnfalse;
{quote}}
#endif
That was actually an intentional change. Previously there was an issue ([Link Removed] - "Oculus + OpenXR startup failure on Samsung Android") where on non-XR android devices it would run some of the OpenXR path and the phone/OS didn't handle it properly and it crashed. So we put this early-out in to prevent problems on non-Android devices. I think this was probably more of an issue when the XR plugins like OpenXR were enabled by default, but they no longer are. Currently there's nothing built into Android to allow us to distinguish between devices that are XR-capable and those that are not, so there might not be a perfect solution
Create a vrtemplate project.
Package for android.
Install to an oculus device, run and see that it enters vr.
Install to an android phone.
Run, see that the app runs in 2d (it'll be messed up because its not intended to run in 2d).
Check log and you should find:
OpenXRHMDModule: App is packaged for Oculus Mobile OpenXR // ten or fifteen other lines of logging Failed to enumerate extensions. Please check that you have a valid OpenXR runtime installed.
Change ProjectSetting->Platforms->Android->Advanced APK Packaging->PackageForOculusMobileDevices emptying the list (it would have quest and quest 2, make it into a zero length list).
Package for android.
Install to an android phone.
Run. See it run in 2d mode.
Check log and you should find:
OpenXRHMDModule: App is packaged for Android OpenXR // ten or fifteen other lines of logging Failed to enumerate extensions. Please check that you have a valid OpenXR runtime installed.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-171662 in the post.
1 |
Component | UE - Platform - XR |
---|---|
Affects Versions | 5.1 |
Target Fix | 5.2 |
Fix Commit | 24216047 |
---|
Created | Dec 1, 2022 |
---|---|
Resolved | Mar 10, 2023 |
Updated | Apr 29, 2023 |