Search Unity

  1. Unity 2019.1 beta is now available.
    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. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

TypeLoadException: Could not load type 'UnityEngine.Analytics.AnalyticsEvent'

Discussion in 'Unity Analytics' started by MayhemMike, Dec 5, 2018.

  1. MayhemMike

    MayhemMike

    Joined:
    Oct 23, 2013
    Posts:
    46
    Performance reporting shows thousands of entries for this exception since I updated my app and I have no idea what could cause this.

    Here's the stack trace:

    System.Type.GetType (System.String typeName, Boolean throwOnError)
    UnityEngine.Monetization.Analytics.InitializeStandardEvents ()
    UnityEngine.Monetization.Analytics.SetAnalyticsEventExtra (System.String key, System.Object value)
    UnityEngine.Monetization.Analytics.SetAnalyticsEventExtra (System.String jsonExtras)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
    UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, System.Object[] args)
    UnityEngine._AndroidJNIHelper.InvokeJavaProxyMethod (UnityEngine.AndroidJavaProxy proxy, IntPtr jmethodName, IntPtr jargs)
    UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)


    I'm using 2018.2.16f.
    Not a single user has complained about a crash so far, so not sure what is happening.
    Any idea what could cause this?
     
  2. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi,
    Can you reproduce this issue on your side?
    Could you please send me the game link on Google Play? I'd like to test it out.
    Thank you.
     
    MayhemMike likes this.
  3. MayhemMike

    MayhemMike

    Joined:
    Oct 23, 2013
    Posts:
    46
    Last edited: Dec 6, 2018
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,409
    @MayhemMike Can you share how you installed the plugin? Did you install from the assetstore? Do you have any other information from the error report such as Android vs iOS, OS version, etc?
     
  5. MayhemMike

    MayhemMike

    Joined:
    Oct 23, 2013
    Posts:
    46
    So I did some extensive digging now. Disclaimer: The Performance Report tool sometimes bugs out and returns no values when selecting filters, so I can't refine my search as much as I like.

    What I found: The error showed up before I implemented the data privacy plugin. It only triggers on the Androidplayer and not in the Editor. (I don't build for iOS). Going through my change logs, the only thing I did that could be relevant was change to il2cpp, upgrade Unity and add one new custom event.
    I tested it now with 2018.2.18f and removed the new event but the exception still gets triggered. According to the overview pretty much all Android versions are affected.
    Meanwhile values on the Analytics dashboard seem as usual.

    It might help to narrow it down if you guys could tell me in which context
    UnityEngine.Monetization.Analytics.InitializeStandardEvents ()
    gets called.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,409
    @MayhemMike We have identified the issue. It turns out that you can safely ignore the message, it's harmless. We are looking to address the issue in an upcoming release.
     
    McGravity and MayhemMike like this.
  7. MayhemMike

    MayhemMike

    Joined:
    Oct 23, 2013
    Posts:
    46
    great, thanks
     
  8. SimuSkippy

    SimuSkippy

    Joined:
    Oct 3, 2016
    Posts:
    5
    Found this error reported in our Cloud Analytics console after our QA team reported the app crashing on some devices (Huawei 6p, Google Pixel). We rolled our cloud build target back to 2017.4.16f1, which seemed to resolve the problem. Are you sure it's harmless?
     
  9. Uldis-Silins

    Uldis-Silins

    Joined:
    Apr 17, 2018
    Posts:
    1
    Same exception here on 2018.1.2f1 Android and iOS

    On iOS exception is:
    System.Exception: TypeLoadException: Could not load type 'UnityEngine.Analytics.AnalyticsEvent' from assembly 'Unity.Analytics.StandardEvents, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
    System.Type.GetType (System.String typeName, Boolean throwOnError)
    UnityEngine.Monetization.Analytics.InitializeStandardEvents ()
    UnityEngine.Monetization.Analytics.SetAnalyticsEventExtra (System.String key, System.Object value)
    UnityEngine.Monetization.Analytics.SetAnalyticsEventExtra (System.String jsonExtras)
    UnityEngine.Monetization.Analytics:SetAnalyticsEventExtra(String)
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,409
  11. lordnedox

    lordnedox

    Joined:
    Jan 7, 2016
    Posts:
    16
    Hi, what should we monitor for the upcoming release which includes this fix? Unity Ads 3 library, standard events, ads package.. or?

    I'm getting hundreds of these errors and though it "might" be harmless, it looks pretty scary in the crash reporting.
     
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,409
    The update would come in an upcoming Unity Editor release.
     
  13. MajidKhosravi

    MajidKhosravi

    Joined:
    Jun 21, 2013
    Posts:
    37
    I am still seeing this in the 2018.2.20f1 , any update on this issue?

    Thanks.