Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Possible to use OpenXR without analytics?

Discussion in 'VR' started by mcclure111, Sep 12, 2023.

  1. mcclure111

    mcclure111

    Joined:
    Dec 10, 2016
    Posts:
    9
    I am a developer of a VR/XR game. I have a project which previously used legacy XR APIs and today I tried moving it to OpenXR. When I enabled OpenXR in Unity Plugin Management it did not work, and I saw I had this error:

    Library\PackageCache\com.unity.xr.openxr@1.8.2\Runtime\OpenXRAnalytics.cs(136,13): error CS0012: The type 'AnalyticsResult' is defined in an assembly that is not referenced. You must add a reference to assembly 'UnityEngine.UnityAnalyticsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

    I am attempting to fix this by installing the "Analytics" package in Unity Asset Manager (it does not work yet). However, even if this works it will not be an acceptable result. I do not have a need for analytics in this project. Collecting analytics would be a violation of my users' privacy, and would require changes to my privacy policy. I do not want to inadvertently ship analytics assemblies which would bloat the size of my project.

    I have two questions.

    1. Does the presence of a "OpenXRAnalytics" in Unity's OpenXR package imply that the OpenXR support is collecting analytics on my users even if I did not enable this?

    2. Is it impossible to install the Unity OpenXR package without installing the Unity base "Analytics" package?
     
    Last edited: Sep 12, 2023
  2. mcclure111

    mcclure111

    Joined:
    Dec 10, 2016
    Posts:
    9
    After quite a bit of fiddling I am unable to get the "you must add a reference to UnityAnalyticsModule" error to go away by adding the "Analytics" package. So maybe I misunderstand what the problem is I'm even trying to solve here.
     
  3. mcclure111

    mcclure111

    Joined:
    Dec 10, 2016
    Posts:
    9
    Update, I deleted packages.json and did a git clean -xffd and after the project finished rebuilding the packages and libraries the error went away. I cannot explain this.
     
  4. mcclure111

    mcclure111

    Joined:
    Dec 10, 2016
    Posts:
    9
    Final update: The problem was not transient, it is reproducible. It is related to which platform is selected in Build Settings. The only reason the clean build fixed it was it reset my platform to PC. I have filed a Unity bug about this. It is either IN-55459 or IN-55462. (I think the first time I filed the submission did not go through and I think only one of these bugs correctly got the files attached.)