Android Question Google Play Game Services library - issues with TurnBasedMultipPlayer [solved with workaround]

Greg Breinholt

Member
Licensed User
Longtime User
I've been (successfully) using this Library to use the Google Play leaderboard:

All worked fine, but suddenly getting the error below. Note that I am not actually using TurnbasedMultiplayer in my code.. but from what I can see, Google has killed this API:

Anyone have any ideas how to resolve this? Does it need an update to the Library removing all links to the removed API?

Greg

Edit: Workaround found Removing/replacing the asynchronous calls stops the crash. See the later comments.

Recommended to use this library:

1606826713749.png
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
So the B4A library needs updating to remove that part of the library? Can anyone besides Informatix do that? I don't know how to.
The Api behind used in the Lib is discontinued.

One need to write a new wrapper for the mentioned new Api.
Note that this Api is maybe/probably not a Free Api.

 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
I'm not sure why you're getting this error. I have a few games that use(d) Google Play Real-Time Multiplayer & I'm not seeing any errors since Google stopped supporting multiplayer. I still have all the code in the apps, but I'm just not calling any of it. Are you sure there's nothing in your code that's referencing turn-based multiplayer? I see in your log, the error is coming from Connection_Success. If you used Informatix's example code, you might have some sneaky references in there.

- Colin.
 
Upvote 0

Greg Breinholt

Member
Licensed User
Longtime User
Thanks - I started watching some of Manfred's library wrapping tutorials, but it might be above my pay grade ;-)

I'm lucky that I only use the Leaderboard features, so hopefully removing the dead APIs would fix my issue (shame for those that will have to try and implement a replacement functionality for the removed Google API's with a new Library).
 
Last edited:
Upvote 0

Greg Breinholt

Member
Licensed User
Longtime User
I'm not sure why you're getting this error. I have a few games that use(d) Google Play Real-Time Multiplayer & I'm not seeing any errors since Google stopped supporting multiplayer. I still have all the code in the apps, but I'm just not calling any of it. Are you sure there's nothing in your code that's referencing turn-based multiplayer? I see in your log, the error is coming from Connection_Success. If you used Informatix's example code, you might have some sneaky references in there.

- Colin.
Let me check again - I haven't changed any of the Leaderboard code for months (and I don't use any multi-player features, unless a sneaky reference snuck in!) It just stopped running with the error above - though up until that point, I also never had any errors for that Library. Andmc also seems to have the same issue, which may or may not be related.
 
Last edited:
Upvote 0

Greg Breinholt

Member
Licensed User
Longtime User
Let me check again - I haven't changed any of the Leaderboard code for months (and I don't use any multi-player features, unless a sneaky reference snuck in!) It just stopped compiling with the error above - though up until that point, I also never had any errors for that Library. Andmc also seems to have the same issue, which may or may not be related.
I don't see any refs to Multiplayer. And yes, I used Informatix Leaderboard example project as the base.
It still creates the connection successfully and signs in, just fails afterwards.

1606973397254.png
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Sorry I've got a work issue at the moment which is taking all my time at the moment.

I did try to update the Informatix Wrapper but then Android Studio needed updating and my VM required more diskspace etc...

I'll see what I can do in the 'background' but work is a priority
 
Upvote 0

Greg Breinholt

Member
Licensed User
Longtime User
Let me check again - I haven't changed any of the Leaderboard code for months (and I don't use any multi-player features, unless a sneaky reference snuck in!) It just stopped running with the error above - though up until that point, I also never had any errors for that Library. Andmc also seems to have the same issue, which may or may not be related.
No problem! Any help appreciated, whenever ;-)
My published app using this is for my own learning and amusement... so for the short-term, I put out an update that shows this when the user tries to access the Leaderboard:
Screenshot (Dec 3, 2020 16_43_02).png
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

eps

Expert
Licensed User
Longtime User
I've finally managed to download the play services and auth services libs from Android Maven repository.

Just unpacking and repackaging...

Only the easy steps done before the next few...

Needed to install the JD PlugIn for Eclipse (which threw a dependency error - trying an online JD)
 
Upvote 0

Greg Breinholt

Member
Licensed User
Longtime User
I've finally managed to download the play services and auth services libs from Android Maven repository.

Just unpacking and repackaging...

Only the easy steps done before the next few...

Needed to install the JD PlugIn for Eclipse (which threw a dependency error - trying an online JD)
Any progress? (no pressure! ;-)
 
Upvote 0

andymc

Well-Known Member
Licensed User
Longtime User
Any progress on updating this library? I would be willing to chip in some $ to help get this done.
Me too! I would be happy to pay for an updated Google paly services library for B4A. I make money from my games and this bug is putting me off developing them any further.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Looking back at what @Greg Breinholt posted - I suspect that the issue is caused when you're using a custom leaderboard & getting the data for it via the LoadLeaderboardMetadata function call. The reason is (I think) that this call invokes the PendingResultWrapper & the PendingResultWrapper source appears to make several references to classes that have been removed from the GPGS API. When the PendingResultWrapper raises the result event in B4A, it maps the result to the corresponding class - & it just so happens that the first mapping attempt is to the CancelMatchResult class, which is why you're seeing that error.

I think that if you used the standard GPGS leaderboards, you wouldn't see this issue. I've been using the standard GPGS leaderboards & achievements for years & haven't made any changes since they deprecated the multiplayer functions, but not seen any issues because of it.

At first glance of the source, it looks like if you removed all the mapping attempts to deprecated classes from the PendingResultWrapper, that would (possibly) resolve the issue - however doing so might also break other parts of the library. I can't say for sure because I haven't had time to look at it closely.

- Colin.
 
Upvote 0

Greg Breinholt

Member
Licensed User
Longtime User
Looking back at what @Greg Breinholt posted - I suspect that the issue is caused when you're using a custom leaderboard & getting the data for it via the LoadLeaderboardMetadata function call. The reason is (I think) that this call invokes the PendingResultWrapper & the PendingResultWrapper source appears to make several references to classes that have been removed from the GPGS API. When the PendingResultWrapper raises the result event in B4A, it maps the result to the corresponding class - & it just so happens that the first mapping attempt is to the CancelMatchResult class, which is why you're seeing that error.

I think that if you used the standard GPGS leaderboards, you wouldn't see this issue. I've been using the standard GPGS leaderboards & achievements for years & haven't made any changes since they deprecated the multiplayer functions, but not seen any issues because of it.

At first glance of the source, it looks like if you removed all the mapping attempts to deprecated classes from the PendingResultWrapper, that would (possibly) resolve the issue - however doing so might also break other parts of the library. I can't say for sure because I haven't had time to look at it closely.

- Colin.
That's correct I am using this code:

B4X:
    'Loads the list of leaderboards   
    Leaderboards.LoadLeaderboardMetadata(True).SetResultEvent("GP_onLeaderboardsLoaded")

I was not aware that I'm using custom Leaderboard - I created one in the Play Console (image below).
Is this classed as custom?

1612147042308.png



Do you know if there an alternative way to create the Leaderboard or get the data from it that would prevent the error?
 
Upvote 0
Top