Search Unity

  1. Full schedule for #UniteBerlin is now available! Featuring talks on our roadmap, hands-on labs and much more! Check it out!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

HELP! Error when using Standard Events

Discussion in 'Unity Analytics' started by Kaldrax, Apr 17, 2018.

  1. Kaldrax

    Kaldrax

    Joined:
    Sep 14, 2017
    Posts:
    8
    Hey Unity team!

    I'm getting this error in Monodevelop when I try to use an AnalyticsEvent:

    The type 'UnityEngine.Analytics.AnalyticsResult' is defined in an assembly that is not referenced. Consider adding a reference to assembly 'UnityEngine.UnityAnalyticsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

    Any advice?
     
  2. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    313
    Hey @Kaldrax ...

    Could you let me know which version of Unity you're using and on which platform? Either myself or someone else on the team can take a look.

    My first guess: have you tried adding
    Code (CSharp):
    1. using UnityEngine.Analytics;
    at the top of your file?
     
  3. Kaldrax

    Kaldrax

    Joined:
    Sep 14, 2017
    Posts:
    8
    Nevermind. Found the DLL and added it.

    Yeah I was using UnityEngine.Analytics
    Mono just didn't seem to have a reference to the UnityAnalyticsModule
     
    marc_tanenbaum likes this.
  4. Ponytech

    Ponytech

    Joined:
    Jun 13, 2016
    Posts:
    7
    Same problem here.
    Can you explain where you found the DLL and where did you add it?
    Thanks!
     
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    907
    @Ponytech

    Can you give us more details about the issue:

    Are you also using Monodevelop?
    Which version of Unity are you using?
    And which platform you are on?
     
  6. Ponytech

    Ponytech

    Joined:
    Jun 13, 2016
    Posts:
    7
    @ap-unity

    Unity 2017.4.1f1
    Mac OS X 10.13.3

    The game works just fine, the issue is in Monodevelop when I want to attach the debugger :

    Error CS0012: The type `UnityEngine.Analytics.AnalyticsResult' is defined in an assembly that is not referenced. Consider adding a reference to assembly `UnityEngine.UnityAnalyticsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' (CS0012) (Assembly-CSharp)
     
  7. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    907
    @Ponytech

    Could you share the script you using when you get this error?
    Do you have the following at the top of the file?

    using UnityEngine.Analytics;
     
  8. Ponytech

    Ponytech

    Joined:
    Jun 13, 2016
    Posts:
    7
    Of course I do, as I said the game works just fine, the problem is only with MonoDevelop when attaching the debugger.

    Example script:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Analytics;
    3.  
    4. public class Game : MonoBehaviour {
    5.  
    6.  
    7.     void Start() {
    8.            AnalyticsEvent.ScreenVisit("Start");
    9.     }
    10. }
    11.  
    12.  
     
  9. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    907
    Last edited: May 14, 2018