googleanalytics / google-analytics-plugin-for-unity

Google Analytics plugin for the Unity game creation system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ClassNotFoundException: com.google.android.gms.analytics.GoogleAnalytics in Unity 5.2.3f1

opened this issue · comments

Using Unity 5.2.3f1, installed the "GoogleAnalyticsv4.unitypackage", following the instruction here: https://developers.google.com/analytics/devguides/collection/unity/v4/devguide, made the changes to the manifest file, and configured the GAv4 plugin exactly as described. Have tried this whole process three 3 times now, starting a new project each time, but getting the same result every time.

Also, I don't have Google Play Services installed, so this doesn't appear to be a conflict anymore between the two.

I/Unity (25244): Initializing Google Analytics 0.2.
I/Unity (25244):
I/Unity (25244): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)
I/Unity (25244):
I/Unity (25244): Initializing Google Analytics Android Tracker.
I/Unity (25244):
I/Unity (25244): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)
I/Unity (25244):
I/Unity (25244): AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.gms.analytics.GoogleAnalytics
I/Unity (25244): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in :0
I/Unity (25244): at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in :0
I/Unity (25244): at UnityEngine.AndroidJavaObject._CallStatic[AndroidJavaObject](System.String methodName, System.Object[] args) [0x00000] in :0
I/Unity (25244): at UnityEngine.AndroidJavaObject.CallStatic[AndroidJavaObject](System.String methodName, System.Object[] args) [0x00000] in :0
I/Unity (25244): at UnityEngine.AndroidJavaObject.FindClass (System.String name) [0x00000] in :0
I/Unity (25244): at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) [0x00000] in :0
I/Unity (25244): at UnityEngine.AndroidJavaClass..ctor (System.String className) [0x00000] in :0
I/Unity (25244): at GoogleAnalyticsAndroidV4.InitializeTracker () [0x00000] in <filen

I encountered the same problem with Unity 5.3.3f1. The fix, according to this stack overflow post, is to get rev 23 of the google play services jar, add it to your project, and set the platform as Android in the inspector.