Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    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?
     
    lior_rosenspitz likes this.
  2. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    314
    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!
     
    lior_rosenspitz likes this.
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    967
    @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)
     
    lior_rosenspitz likes this.
  7. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    967
    @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:
    967
    Last edited: May 14, 2018
  10. phong-genix

    phong-genix

    Joined:
    Oct 28, 2015
    Posts:
    103
    lior_rosenspitz likes this.
  11. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    967
    @Ponytech, @phong-genix

    Yeah, those issues are probably related. There is a fix in review for 2017.4 and 2017.3. Hopefully this will be resolved in an upcoming patch.
     
    phong-genix likes this.
  12. UDN_f2797471-3ee5-4459-87fe-e6f33e1d8670

    UDN_f2797471-3ee5-4459-87fe-e6f33e1d8670

    Joined:
    Apr 21, 2016
    Posts:
    14