Search Unity

Migrating to XR plugin for Google Cardboard

Discussion in 'VR' started by lz7cjc, May 28, 2020.

  1. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    Hi
    I am in a bit of a mess. I had a working version of my app using the legacy VR software but now I am stuck with the new system with no understanding of how to make it work:

    I need to do the following:
    Head tracking/looking around my scene
    Reticle pointer/choose element using event trigger (gaze and pick)
    Control/test in editor - currently using GvrEditorEmulator. This works but doesn't reflect what happens when i build the apk. i.e. everything works fine in the emulator but when i try to run as VR on my phone it doesn't work. Further when i run the demo Hello Cardboard scene in the editor none of the old controls work. How can i test this scene in editor?
    Toggle between VR and non-VR states - XRSettings.enabled = true;

    I have followed these instructions but can't see anything that helps me do any of this.

    https://docs.unity3d.com/Manual/configuring-project-for-xr.html
    https://docs.unity3d.com/Packages/c...1/manual/index.html#Migrating-a-complex-Scene

    Where can I find the documentation for cardboard that will explain how to do each of these things? Or better yet an easy to follow tutorial or set of help files!

    thanks

    NB I am getting this error; wondering if this might be causing some of the problems i am experiencing. How do i fix?
    DllNotFoundException: cardboard_api
    Google.XR.Cardboard.Api.HasDeviceParams () (at Library/PackageCache/com.google.xr.cardboard@8979e065b7/Runtime/Api.cs:101)
    CardboardStartup.Start () (at Assets/Samples/Google Cardboard XR Plugin for Unity/1.1.0/Hello Cardboard/Assets/Scripts/CardboardStartup.cs:39)
     
    makaka-org, rlaginsel and linojon like this.
  2. tsumikiHUANG

    tsumikiHUANG

    Joined:
    May 15, 2018
    Posts:
    2
    I have the same problem...
     
  3. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    I upgraded to the latest version of the Unity editor which seems to have sorted much of this out. Couple of things to note:
    when choosing the gradle template, uncheck the old one
    Uncheck using the old VR system in player settings
    I am continuing to use the old GVRemulator to control the game in the editor
    You may need to uninstall and reinstall the google plugin - this was the last action i did before it started working.
    The one thing I still can't do is switch between 2d and VR - anyone got any idea how to do this?
    thanks
     
  4. pithakoteTata

    pithakoteTata

    Joined:
    Oct 18, 2019
    Posts:
    18

    What version of unity are you using for the Mobile VR development?


    Thanks
     
    Last edited: Aug 12, 2020
  5. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    @pithakoteTata 2019.4.0f1
    NB: I am developing on windows and have kept the old system to allow me to run and use the gvremulator to navigate my game whilst in the Editor for testing.

    To build for Mac you have to remove all traces of the old system to avoid build errors in XCode, so don't expect to be able to test in the same way... at least not until someone comes up with a solution. If someone does have a solution to this do let me know! I gave up looking at the end of May and accepted the hack i am currently using.
     
  6. rlaginsel

    rlaginsel

    Joined:
    Aug 29, 2020
    Posts:
    2
    Im currently stumbeling on this too..
    I clean installed unity version 2019.4.9f1 on windows and did every step in tutorial the right way.
    I hope some one has the answer to this so I thought I'd give this some more attention by writing a reply.

    Same error:
    DllNotFoundException: cardboard_api
    Google.XR.Cardboard.Api.HasDeviceParams () (at Library/PackageCache/com.google.xr.cardboard@8979e065b7/Runtime/Api.cs:101)
    CardboardStartup.Start () (at Assets/Samples/Google Cardboard XR Plugin for Unity/1.1.0/Hello Cardboard/Assets/Scripts/CardboardStartup.cs:39)
    Using SDK version API level 29

    When building on my Xaomi note 7 (Android) all I see is a black screen
     
  7. SortOth

    SortOth

    Joined:
    Jul 3, 2017
    Posts:
    3
    I absolutely am enraged that iOS 14 is forcing us to use this *totally undocumented*, *initial setup fudged*, *overly complicated*, *unreadable*, *closed-source*, *not flexible*, *backwards incompatible*, *old hardware refusing* and *it's resources consuming* Google XR plugin, when all of those classic 5+ year old GVR apps were and are working fantastically! Is it going to become mainstream to just start ditching backwards-compatibility on a massive scale? Am I not seeing where's the bright side?
    It's been well over half a year since I first cloned Cardboard XR, and it STILL has the same modest documentation, tutorials, demos (just a single demo actually which is the only way now how to use it).

    I got stuck on the same error btw, and that was the final drop for a rage reply.
     
  8. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,026
    Hi, Guys, I also had inconveniences with new version of plugin. I'm doing Mixed Reality. So for now Google Cardboard XR Plugin is still under development, but with every new version more & more bugs are fixed.

    Hope you will find this useful. Here I implemented Reticle Pointer & Basic Editor Testing for new Google Cardboard XR Plugin with Mixed Reality way.

    Project was published as Unity Asset called AR + VR: MR Camera.

     
    dimitriOgnibene likes this.
  9. sateyr

    sateyr

    Joined:
    Mar 6, 2013
    Posts:
    10
    I havent errors in Android. Make sure that you have selected Android platform in Build Setting, it's an idiot thing that can happen ;)


    I had that error on iOS.
    1- Make sure that you have selected iOS platform in Build Setting.
    2- Optional: If you are migrating from the old cardboard plugin:
    2.1- Delete all folders/files of the old Cardboard plugin.
    2.2- Disable Virtual Reality Supported in Project Settings --> Player --> XR Settings
    upload_2020-10-29_10-32-42.png

    3- Close Unity
    4- Delete Libray Folder
    5- Open Unity again
    6- A similar error will be displayed when trying to compile
    Error: "Plugin 'cardboard_api.a' is used from several locations"

    Move the next iOS folder to the folder Plugins in the project, and now i can compile without errors.
    upload_2020-10-29_10-15-22.png

    upload_2020-10-29_10-24-13.png
     

    Attached Files: