googleanalytics / google-analytics-plugin-for-unity

Google Analytics plugin for the Unity game creation system
Apache License 2.0
386 stars 140 forks source link

GA4 Unity problem AndroidJavaException? #177

Open kkohno opened 6 years ago

kkohno commented 6 years ago

I getting the following issue on android. Bug in plugin - I made an empty project Unity version 2018.2.2f1 to check this and get this issue, but on Editor is ok.

adb logcat:

AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/Preconditions; java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/Preconditions; at com.google.android.gms.internal.measurement.zzat.zzc(Unknown Source) at com.google.android.gms.analytics.GoogleAnalytics.getInstance(Unknown Source) at com.unity3d.player.UnityPlayer.nativeRender(Native Method) at com.unity3d.player.UnityPlayer.c(Unknown Source) at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source) at android.os.MessageQueue.next(MessageQueue.java:392) at android.os.Looper.loop(Looper.java:136) at com.unity3d.player.UnityPlayer$e.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.Preconditions" on path: DexPathList[[zip file "/data/app/com.pixel.gun.combats-1/base.apk"],nativeLibraryDirectories=[/data/app/com.pixel.gun.combats-1/lib/arm, /data/app/com.pixel.gun.com

ido567 commented 5 years ago

Did you find the problem? @kkohno

ColorTwist commented 5 years ago

Same here- 2018.2.6 Seems issue is related to gradle. Any resolve for this?

ido567 commented 5 years ago

Eventually, I didn't use the SDK directly and used this plugin: https://assetstore.unity.com/packages/3d/characters/google-analytics-sdk-16317