googleanalytics / google-analytics-plugin-for-unity

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

V4, Android - ClassNotFoundException : com.google.android.gms.analytics.GoogleAnalytics #155

Open alaslipknot opened 7 years ago

alaslipknot commented 7 years ago

Hello,

I was just looking into issue#86 which has this problem solved, but I couldn't find the "Setup" they are talking about :

Did you copy play services into your Unity project? See the setup option in the top menu under Google Analytics.

Any Help please ?

alaslipknot commented 7 years ago

Solved it, (no idea why these steps are not mentioned in the Docs...)

This should import all necessary Jars as long as your Android SDK is updated, more specifically this folder should exists : sdk\extras\google\m2repository\com\google\android\gms

And it needs to have play-services-analytics and play-services-analytics-impl

I've seen some post saying that you need to copy play-services-analytics-10.2.6.aar and play-services-analytics-impl-10.2.6.aar from these folders respectively and put them in your unity Plugins/Android folder. but for me after doing the step above, these were added automatically.

TL;DR : The Play Service Resolver in this package is broken (or the docs are missing something) importing the correct one fixed it for me.

RandomCouch commented 7 years ago

Thank you @alaslipknot, I was not able to find these steps in the Docs either but this fixed some issues I was having but then gave me more errors, these errors were related to me not having set the JAVA_HOME environment variables correctly, once that was done it all worked perfectly for me.