question

fiveampsoftware avatar image
fiveampsoftware asked

Android Push Plugin not functioning with latest PlayGamesPlugin

We recently updated our Unity to Unity 5.5.0f3. With this we had to update our Google Play Games library to get it working with the Unity version. We are using the official Google Play Games plugin from here: https://github.com/playgameservices/play-games-plugin-for-unity

With this change, we have seen the Push notification fail on a few occasions with Google Play Games plugin. We are using the Playfab's Push notification from here: https://github.com/PlayFab/UnitySDK/tree/master/Packages/PushNotification_Unity5_0

The following fail cases are with the latest Google Play Games plugin installed.

The PlayFab push notification plugin comes with a few conflicting libraries initially against the Google Play Games plugin. The supportv4 and annotations are higher in version but the googleplayservices base and basement are lower versions.

If we overwrite all of the Google Play Plugin versions w/ the PlayFab plugin we get the following when we build -

stderr[ Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/api/signin/internal/zze; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/api/signin/internal/zzk; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzamk; Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzaml;

and then if we do the importing of the PlayFab plugin again but this time we only accept the higher versions of all plugins (keeping the supportv4 and annotations that PlayFab provides but discard the base and basement plugins), it builds fine but when we initiate the push call from here: https://api.playfab.com/docs/push-for-android we get a crash in the game with a trace of the following:

Caused by: java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzx; or its super classes (declaration of 'com.google.android.gms.common.util.zzx'

01-25 23:07:53.795 1213 1848 E AndroidRuntime: at com.google.android.gms.iid.zzd.zzkf(Unknown Source)

01-25 23:07:53.795 1213 1848 E AndroidRuntime: at com.google.android.gms.iid.zzd.<init>(Unknown Source)

01-25 23:07:53.795 1213 1848 E AndroidRuntime: at com.google.android.gms.iid.zzd.<init>(Unknown Source)

01-25 23:07:53.795 1213 1848 E AndroidRuntime: at com.google.android.gms.iid.InstanceID.zza(Unknown Source)

01-25 23:07:53.795 1213 1848 E AndroidRuntime: at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)

01-25 23:07:53.795 1213 1848 E AndroidRuntime: at com.playfab.unityplugin.GCM.PlayFabRegistrationIntentService.onHandleIntent(PlayFabRegistrationIntentService.java:39)

Has PlayFab's Push notification plugin been tested w/ 5.5 or with Google's latest version of the Google Play Games plugin?

Thanks,

Kevin

Push Notifications
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

This is a known issue which we're working on a fix for now - we hope to have it available in the next few weeks. Full details on this are available in this thread: https://community.playfab.com/articles/7564/unity-how-do-i-get-google-plus-signin-working-usin.html.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

fiveampsoftware avatar image fiveampsoftware commented ·

Hi Brendan - has there been an update on this issue? Just a friendly check in, thanks!

0 Likes 0 ·
brendan avatar image brendan fiveampsoftware commented ·

Yes, now that we have updated our authentication system to use Google's newer token system, can you try getting the latest version of our SDK and see if that helps with this? The plugins should no longer have these conflicts.

0 Likes 0 ·
andrestallos avatar image andrestallos brendan commented ·

Hi Brendan, I suspect we're still having the same issue described here, after updating to the latest version of the Playfab's SDK and AndroidPushPlugin 5.0. Using Unity 5.5.1p4, the latest Firebase SDK, and Google Play Games v0.9.36.

We get the 'Unable to convert classes to dex format' error on compilation, and the only way we've managed to compile is to delete the appcompat-v7-24.1.1.aar library. But then the setup in the plugin example doesn't work: OnGCMReady(bool status) never gets called after PlayFabAndroidPlugin.Init(). We assume is probably related to the missing library.

In spite of that, we have managed to successfully make an AndroidDevicePushNotificationRegistrationRequest by passing the token obtained through the Firebase process, and got to the point where we can successfully send notifications and receive them while in-game, just as described here: https://community.playfab.com/questions/5492/android-manifest-for-push-notifications.html

I see in other threads that there has been some progress mentioned after the last edits of the Playfab sample (5 months ago) and AndroidPushPlugin_5.0 package (6 months ago). Is it possible that those are not fully up to date? Thank you!

0 Likes 0 ·
Show more comments
marcowilliamspf avatar image
marcowilliamspf answered

@andrestallos correct you have to rollback your GPG to the right version that correlates with the version ( sorry I can't remember what that is at the moment ) of our jar files we use for Push.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

andrestallos avatar image andrestallos commented ·

Thank you for the quick reply, @MarcoWilliamsPF! That makes sense. We've tried with GPG 0.9.35 and it's also asking for Support-v4-24.0.0, though :/ We fear rolling back to an earlier version will cause a whole other load of problems, so we'll just hold back until the plugin is updated before implementing Playfab push. We managed to get Firebase push working for normal broadcast, so we can wait before implementing the more advanced stuff (like automatic notifications when entering/leaving a segment, which seems very powerful). Thanks

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.