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

initialize Cardboard XR loader before calling this function #324

Closed
2 tasks done
KristynaPavlatova opened this issue Jan 22, 2022 · 2 comments
Closed
2 tasks done
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@KristynaPavlatova
Copy link

KristynaPavlatova commented Jan 22, 2022

SPECIFIC ISSUE ENCOUNTERED

Google's Cardboard VR sample scene in Unity gives an error.
Issue is in HelloCardboard sample scene from the Google Cardboard imported plugin.
Error message:
Please initialize Cardboard XR loader before calling this function.
UnityEngine.Debug:LogError (object)
Google.XR.Cardboard.Api:UpdateScreenParams () (at Library/PackageCache/com.google.xr.cardboard@891dec0b1a/Runtime/Api.cs:295)
CardboardStartup:Update () (at Assets/Samples/Google Cardboard XR Plugin for Unity/1.11.0/Hello Cardboard/Scripts/CardboardStartup.cs:70)

Unity 2020.3.20f1, android build
Packages installed: XR Plugin management, Google Cardboard XR Plugin for Unity (installed through GIT, import package via URL)
Google Cardboard imported as it is described here: https://developers.google.cn/cardboard/develop/unity/quickstart

SMARTPHONE (please complete the following information):

  • Device: Samsung Galaxy S8+
  • OS
    • Android
  • OS version: Android 9, API level 27

STEPS TO REPRODUCE THE ISSUE

  1. Have GIT installed on your PC
  2. Create empty 3D project in Unity
  3. in the project go to Package Manager > + > import with URL > paste the given URL from the "Google's Quickstart for Google Cardboard" (the link to import package: https://github.com/googlevr/cardboard-xr-plugin.git)
  4. In Package Manager > XR Plugin management > import
  5. In Assets > Samples > ... > Hello Cardboard > Scenes > open the HelloCardboard scene
  6. Editor > Project settings > XR Plug-in Management > Android > check "Initialize XR on startup" & check "Cardboard XR Plugin" in the Plug-in providers section
  7. Back in the HelloCardboard scene hit Play button and the error message shows up "Please initialize Cardboard XR loader before calling this function.
    UnityEngine.Debug:LogError (object)
    Google.XR.Cardboard.Api:UpdateScreenParams () (at Library/PackageCache/com.google.xr.cardboard@891dec0b1a/Runtime/Api.cs:295)
    CardboardStartup:Update () (at Assets/Samples/Google Cardboard XR Plugin for Unity/1.11.0/Hello Cardboard/Scripts/CardboardStartup.cs:70)"

EXPECTED BEHAVIOR

HelloCardboard scene can be played without any errors.

VERSIONS USED

Cardboard SDK/Cardboard XR Plugin 1.11.0
Unity 2020.3.20f1, android build

  • Select in which graphics API you can reproduce the bug.
    • Automatic graphics API

Screenshot (336)
Screenshot (335)
Screenshot (334)

@KristynaPavlatova KristynaPavlatova added the bug Something isn't working label Jan 22, 2022
@arilow arilow added the duplicate This issue or pull request already exists label Jan 25, 2022
@arilow
Copy link

arilow commented Jan 25, 2022

Thanks @KristynaPavlatova for reaching out to us! I confirm that I could reproduce your issue.

Currently, Editor Play mode is not supported by the Cardboard SDK. That is why the error message appears when the play button is pressed.
At the moment, the Cardboard XR Plugin can only be executed on Android and iOS devices as it is pointed out in the Quickstart.
Issue #51 is currently tracking the feature request for adding Editor Play mode support. I’m closing this issue now as it is a duplicate of the aforementioned one.

Thanks!

@arilow arilow closed this as completed Jan 25, 2022
@Cat9199
Copy link

Cat9199 commented Feb 15, 2024

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants