New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Play Games Compatibility #109

Open
DuskLightStudios opened this Issue Mar 19, 2016 · 5 comments

Comments

Projects
None yet
5 participants
@DuskLightStudios
Copy link

DuskLightStudios commented Mar 19, 2016

I ran into an issue regarding the compatibility between Google Analytics and Google Play Games services. After a lot of experimenting and research, I've figured out that the issue is about the Google Play Services library.

Google Play Games removes this library and replaces it with .aar files. Theoretically a good idea, since it clears up a lot of app size. But it breaks Google Analytics, which needs that library to function.

I've tried including the analytics aar file into the dependencies, as described here:
#51

But that didn't work. The result is that Google Play Games works, but the app crashes after a few seconds due to Google Analytics. My Google Analytics works great if Google Play Games is not included in the game.

A lot of people seem to have this issue, but there seems to be no clear solution for it anywhere. What can I do to fix this?

@DuskLightStudios

This comment has been minimized.

Copy link
Author

DuskLightStudios commented Mar 20, 2016

Problem resolved. I didn't expect to find it this quickly. Apologies for somewhat hastely posting about this issue!
I actually solved the issue awhile back, but I believed the solution didn't work because a completely different bug was crashing my app the entire time. So after solving that, I discovered my issue was already gone.

The only thing you need to do to get Google Analytics to work with Google PlayGames is:

  1. Install Google Analytics as described in their readme
  2. Install Google PlayGames as described in their readme
  3. Don't add the 'google-play-services_lib' folder in 'Assets/Plugins/Android', and if you did, simply delete it.
  4. Add the following code to GPGSDependencies.cs

svcSupport.DependOn("com.google.android.gms",
"play-services-analytics",
PluginVersion.PlayServicesVersionConstraint);

That should remove the compatibility issue, and allow you to run the code.
Do make sure both plugins work independently first. Otherwise, you might get a problem with one of them, and believe it's about compatibility.

@holkarpk

This comment has been minimized.

Copy link

holkarpk commented May 13, 2016

Thanks it save my time

@isanjosgon

This comment has been minimized.

Copy link

isanjosgon commented Jun 7, 2016

I had a similar issue, and I solved it adding all the Google libs at the same version.

I.

screen shot 2016-06-07 at 12 18 37

@cethak89

This comment has been minimized.

Copy link

cethak89 commented Sep 29, 2016

DuskLightStudios your way doesnt solve my problem. I have last version of google analytics (V4) and also last version of google play game service ( 9.34). In editor no problem but in android i took this exception from logging with adb:

java.lang.NoSuchMethodError: No static method zzy(Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzab; or its super classes (declaration of 'com.google.android.gms.common.internal.zzab' appears in /data/app/com.HTGames.blinkblock-2/base.apk)
09-29 18:41:40.941 10507 10538 I Unity : at com.google.android.gms.analytics.internal.zzf.zzay(Unknown Source)
09-29 18:41:40.941 10507 10538 I Unity : at com.google.android.gms.analytics.GoogleAnalytics.getInstance(Unknown Source)
09-29 18:41:40.941 10507 10538 I Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
09-29 18:41:40.941 10507 10538 I Unity : at com.unity3d.player.UnityPlayer.a(Unknown Source)
09-29 18:41:40.941 10507 10538 I Unity : at com.unity3d.player.UnityPlayer$b$1.handleMessage(Unknown Source)
09-29 18:41:40.941 10507 10538 I Unity : at android.os.Handler.dispatchMessage(Handler.java:98)
09-29 18:41:40.941 10507 10538 I Unity : at android.os.Looper.loop(Looper.java:158)

if you have an idea i will be really grateful

@mohsinsiddiqui

This comment has been minimized.

Copy link

mohsinsiddiqui commented Mar 31, 2017

just edit AndroidManifest file and set min sdk and target sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment