Jump to content

Android Native (C++) OpenXR Application. HTC Vive Focus 3


Recommended Posts


I am trying to build an Android app that initializes the OpenXR Runtime in C++ for the HTC Vive Focus 3

The problem is that the application fails at the xrCreateInstance() method provided by the OpenXR loader, which should pass the requested function to the runtime.  The encountered error seems to be an access violation (SIGSEV) due to a nullptr, when trying to find the xrCreateInstance method in the runtime. (maybe the function does not exist?).

The stacktrace of the error:

art_sigsegv_fault 0x00000077a19766dc
art::FaultManager::HandleFault(int, siginfo*, void*) 0x00000077a1976be0
art::SignalChain::Handler(int, siginfo*, void*) 0x000000566c858ec4
__kernel_rt_sigreturn 0x0000007828ce8678
<unknown> 0x0000007734936ae8
RuntimeInterface::CreateInstance(const XrInstanceCreateInfo *, XrInstance_T **) runtime_interface.cpp:457
LoaderXrTermCreateInstance(const XrInstanceCreateInfo *, XrInstance_T **) loader_core.cpp:423
LoaderInstance::CreateInstance(XrResult (*)(XrInstance_T *, const char *, void (**)()), XrResult (*)(const XrInstanceCreateInfo *, XrInstance_T **), XrResult (*)(const XrInstanceCreateInfo *, const XrApiLayerCreateInfo *, XrInstance_T **), std::__ndk1::vector<…>, const XrInstanceCreateInfo *, std::__ndk1::unique_ptr<…> *) loader_instance.cpp:250
LoaderXrCreateInstance(const XrInstanceCreateInfo *, XrInstance_T **) loader_core.cpp:275
xrCreateInstance(const XrInstanceCreateInfo *, XrInstance *) loader_core.cpp:835
main_body() list_json.cpp:137


The basics steps I took were:


What I already tried:

  • Created my own Android app with a Native side.
    • Error encountered.
  • Built the Android sample app by Khronos using this repo: https://github.com/KhronosGroup/OpenXR-SDK-Source.
    • Same error.
  • Enumerating the features creating the instance.
    • This works fine, the runtime lists a total 22 supported features.
  • Used a selection of different OpenXR loaders.
    • All of them encounter the same issue.
  • Running a the handtracking unity sample to see if it is an issue with the device. 
    • Works.


If anybody has already done something similar I would be glad on some insight about what I might have missed. Does it maybe need some preconfiguration?


Kind regards



Link to comment
Share on other sites

Hi Philipp!

Creating a C++ application using the open source loader is something that has been done by a few folks, so I'm a little confused as to what the error may be.

Using the hello_xr app that's a part of https://github.com/KhronosGroup/OpenXR-SDK-Source seems to work just fine for me, does that also work for you?

What other functionality other than what is in hello_xr sample above are you using? Can you fork and create a branch with these changes?


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...