Search Unity

Analytics Library 3.3.2 does not compile in 2019.1

Discussion in 'Unity Analytics' started by Havokki, Sep 17, 2019.

  1. Havokki

    Havokki

    Joined:
    Jun 28, 2015
    Posts:
    118
    I added Analytics Library 3.3.2 into the project with the Package Manager, but I got these compilation errors:

    Library/PackageCache/com.unity.analytics@3.3.2/DataPrivacy/DataPrivacyButton.cs(47,17): error CS0103: The name 'RemoteSettings' does not exist in the current context
    Library/PackageCache/com.unity.analytics@3.3.2/DataPrivacy/DataPrivacy.cs(42,26): error CS0103: The name 'AnalyticsSessionInfo' does not exist in the current context
    Library/PackageCache/com.unity.analytics@3.3.2/DataPrivacy/DataPrivacy.cs(43,29): error CS0103: The name 'AnalyticsSessionInfo' does not exist in the current context

    My Unity version is 2019.1.14f1 and analytics are enabled in the services window.

    I already tried removing the package and adding it again. Also tried clearing the PackageCache folder and restarting Unity.

    Any idea how to fix this?


    EDIT: Also noticed that 3.3.2 is marked as 2019.1 verified only if you do not have it installed. Once you install it, it loses the verified tag and has preview tag instead.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You might try "Reset packages to default" under the Help menu. Do you have the Data Privacy asset also in your project?
     
  3. Havokki

    Havokki

    Joined:
    Jun 28, 2015
    Posts:
    118
    Hi again, sorry for the long delay. I reset all packages to default and added them back one by one. No compiler errors this time. Thanks!

    Any idea what triggers this issue?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you could provide specific steps to reproduce, we may be able to determine what triggers it.
     
  5. Havokki

    Havokki

    Joined:
    Jun 28, 2015
    Posts:
    118
    I think I have some more information on why it happened. When I searched Package Manager for anything related to analytics, it only showed one package.
    manager.png

    Installing it only added com.unity.modules.unityanalytics into the manifest and resulted in compiler errors. Reseting packages to default, then installing Unity Analytics and reverting all other changes to the manifest, I ended up with two new packages: com.unity.modules.unityanalytics and com.unity.analytics. No compiler errors this time.
    manifest.png

    (The change to Memory Profiler shown in the screenshot is not related to the issue.)
     
  6. unity_NDDJe-IzeRlkjQ

    unity_NDDJe-IzeRlkjQ

    Joined:
    Jan 5, 2019
    Posts:
    1
    you have to log out and re log in into unity, it worked for me
     
  7. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Thanks for mentioning the fix here @Yozaro!
     
  8. eddyb

    eddyb

    Joined:
    Mar 6, 2013
    Posts:
    5
    I somehow got this error as well after adding
    "com.unity.services.analytics": "2.0.7-pre.7"
    (trying the new analytics Beta), reverted to try something else, then tried re-adding it.

    After going through the same "Reset Packages To Default", and cleaning up the chaff, I see
    "com.unity.modules.unityanalytics": "1.0.0"
    got added as well, which seems to have solved the problem. weird voodoo.

    Thanks for the question and the answer Havokki!
     
    SebT_Unity likes this.