Description

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

  1. // TODO: Allow OpenXR on non-Oculus Android platforms

  2. if (AndroidThunkCpp_IsOculusMobileApplication())

  3. {

  4. UE_LOG(LogHMD, Log, TEXT("OpenXRHMDModule: App is packaged for Oculus Mobile"));

  5. {quote}}

    else
    {{quote}
  6. UE_LOG(LogHMD, Log, TEXT("OpenXRHMDModule: App is not packaged for Oculus Mobile"));

  7. returnfalse;

  8. {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

Steps to Reproduce

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.

 

 

 

 

 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-171662 in the post.

1
Login to Vote

Fixed
ComponentUE - Platform - XR
Affects Versions5.1
Target Fix5.2
Fix Commit24216047
CreatedDec 1, 2022
ResolvedMar 10, 2023
UpdatedApr 29, 2023
View Jira Issue