V4, Android - ClassNotFoundException : com.google.android.gms.analytics.GoogleAnalytics
alaslipknot opened this issue · comments
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 ?
Solved it, (no idea why these steps are not mentioned in the Docs...)
-
Delete the PlayServiceResolver folder that you get from unpacking the googleAnalytics package.
-
Download the PlayServiceResolver from this repo
-
In unity Menu :
Assets -> Play Service Resolver
-> Version Handler -> Update
-> Android Resolver -> Resolve Client Jars
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.
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.