Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

"AnalyticsEvent does not exist" error appears, but Unity Analytics is ON

Discussion in 'Editor & General Support' started by Kristina_B, Jan 21, 2020.

  1. Kristina_B

    Kristina_B

    Joined:
    Mar 28, 2019
    Posts:
    13
    So I wanted to create a new project based on the existing (published) one.
    I imported all assets from the old one to the empty new one, copied the Settings folder.

    Everything works fine, except Unity Analytics events - they show the following error:
    Assets\Scripts\Data\GameData.cs(485,9): error CS0103: The name 'AnalyticsEvent' does not exist in the current context

    I have a reference to Analytics service
    Code (CSharp):
    1. using UnityEngine.Analytics;
    ... and Analytics service is ON - and "Develop" tab of the project dashboard also shows that it's ON.
    It's a separate project on both Editor launcher and web dashboard, so I believe there shouldn't be problems with project IDs (might be wrong).

    What am I missing?
     
  2. Kristina_B

    Kristina_B

    Joined:
    Mar 28, 2019
    Posts:
    13
    It appeared that I didn't install the Analytics library - Unity customer support addressed this question on the same day.
    Ticket closed.
     
  3. AGameByBrad

    AGameByBrad

    Joined:
    Jun 5, 2020
    Posts:
    2
    Go to
    Window - > "Package Manager"
    Analytics Library - > Install.
     
  4. krisventure

    krisventure

    Joined:
    Mar 24, 2016
    Posts:
    118
    Note that Package Manager's been a bit more confusing with the new naming, it took me some time to find this Analytics Library even after I've heard of it because it's now under the "Unity Registry" tab of Package Manager (instead of the old naming "All Packages"). It's not the same as Unity Analytics package under the Built-in tab which is auto-installed. Analytics Library has to be installed manually from the Unity Registry tab. At least in Unity 2020.3
     
  5. Ryuuguu

    Ryuuguu

    Joined:
    Apr 14, 2007
    Posts:
    387
    I'm using 2021.3.16f1 and in the silicon version ( for mac with M! chip) there is no Analytics library in the packages unity registry. it does exist in the intel version for macs.
    [Edit] also check ed the 2021.3.19f1 Silicon version and filed a bug report.
     
    Last edited: Feb 18, 2023