Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. 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:
    22
    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:
    316
    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:
    22
    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:
    14
    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:
    1,021
    @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:
    14
    @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:
    1,021
    @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:
    14
    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:
    1,021
    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:
    1,021
    @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
  13. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,021
    We do have a fix ready for this and a patch should be available soon (if not already). Thanks everyone for reporting this issue.