Search Unity

  1. Unity 2018.3 is now released.
    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. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    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:
    42
    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:
    219
    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:
    42
    Last edited: Dec 6, 2018
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    2,825
    @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:
    42
    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:
    2,825
    @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.
     
    MayhemMike likes this.
  7. MayhemMike

    MayhemMike

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

    SimuSkippy

    Joined:
    Oct 3, 2016
    Posts:
    4
    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:
    2,825
  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:
    2,825
    The update would come in an upcoming Unity Editor release.