Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Version 2.4.0 fails for all build targets except standalone and android #5

Open
Marbl70 opened this issue Jul 3, 2024 · 2 comments

Comments

@Marbl70
Copy link

Marbl70 commented Jul 3, 2024

When importing the latest version 2.4.0 into Unity where the build target is set to WebGL or iOS or anything except standalone and android there are a number of errors in the console, preventing builds.

..
Library\PackageCache\com.htc.upm.vive.openxr@3dd72f5\Runtime\CompositionLayer\Scripts\CompositionLayerPassthroughAPI.cs(641,22): error CS0161: 'CompositionLayerPassthroughAPI.SetPassthroughLayerType(int, LayerType, uint)': not all code paths return a value
...

In those functions there is an ifdef missing:

#if !(UNITY_STANDALONE || UNITY_ANDROID)
return false;
#endif

This prevents us from using this version of the sdk as we are building for multiple targets, please fix asap.

Thanks,
Martin

@tony-phlin
Copy link
Contributor

Thanks for the feedback. We'll fix in next release.

@aaronaccessvr
Copy link

aaronaccessvr commented Nov 6, 2024

👍 for fixing this in the "next release". For anyone who finds there way here, the solution is as follows: go into PackageCache, take the imported codebase, pull it into your Packages folder, and update manifest.json as follows:

"com.htc.upm.vive.openxr": "file:./com.htc.upm.vive.openxr"

This way, you can go into CompositionLayerPassthroughAPI.cs and modify it as needed. In my case, the modification was to add something like this to each of the functions that otherwise lack return values:

#if UNITY_IOS
    return false;
#endif

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants