Android游戏排行榜在测试时被打破 [英] Android games leaderboard broken while testing

查看:138
本文介绍了Android游戏排行榜在测试时被打破的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功将Google Games API集成到我的应用中,现在我可以看到我的排行榜和成就,如此处此处分别.

I have successfully integrated the Google Games API in my app, and now I can see my leaderboard and achievements as described here and here respectively.

但是,当尝试使用此代码提交分数时:

However, when trying to submit a score using this code:

Games.Leaderboards.submitScore(mGoogleApiClient, getString(R.string.play_console_leaderboard_id), 100);

由于某些原因排行榜停止出现.实际上,它开始加载,然后直接消失. 此帖子似乎描述相同的问题,但是没有发布解决方案.

for some reason the leaderboard stops appearing. Actually it starts loading, and then directly disappears. This post seems to describe the same issue, however there is no solution posted.

我知道这与SubmitScore有关,因为当我创建一个新的排行榜时,我可以成功打开它并看到一条消息,提示没有人报告任何分数.再说一次,如果我尝试提交分数,排行榜将再次中断.

I know that it has to do with the submitScore because when I create a new leaderboard, I can successfully open it and see the message that no one has reported any score. Then again, if I try to submit a score, the leaderboard again breaks.

对此有任何提示/建议吗? 谢谢.

Any hints / suggestions on that? Thanks.

编辑:我开始认为出于某种原因,这可能与Play控制台中的篡改保护有关.尽管即使我尝试禁用它,问题仍然存在.

I am starting to believe that for some reason it may have to do with the tamper protection from the Play Console. Although even when I tried to disable it, the problem still persists..

EDIT2 :我是否必须发布游戏才能测试排行榜?我知道这听起来很奇怪.

Do I have to publish my game so I can test the leaderboards? I know that it sounds weird.

推荐答案

在使用commitScoreImmediate测试之后,我看到我得到了STATUS_CLIENT_RECONNECT_REQUIRED.根据帖子,我认为我必须使用我的debug.keystore创建另一个OAUTH客户端ID.

After testing with the submitScoreImmediate, I saw that I got STATUS_CLIENT_RECONNECT_REQUIRED. Based on this post, I figured that I had to create another OAUTH client id, using my debug.keystore.

这是事实;当我创建一个由发行证书签名的APK并进行尝试时,一切正常.

And this was true; when I created a release certificate-signed APK and tried it, everything worked.

现在,Google在此处提及以下内容:

Now, Google mentions here the following:

注意:如果您要使用调试证书调试游戏,但是 已经使用您的发行证书配置了游戏服务,您 应该使用相同的软件包名称添加另一个链接的应用,并且您的 调试证书的SHA1指纹.这将允许您登录 到应用程序,无论它是通过调试还是发行版签名 证书.

Note: If you are debugging your game using your debug certificate but have configured games services using your release certificate, you should add a second linked app using the same package name and your debug certificate's SHA1 fingerprint. This will allow you to sign in to the application whether it's signed with the debug or release certificates.

但是,如果我尝试将第二个应用程序与相同的程序包链接,则我将无法应用另一个SHA1指纹,因为没有出现批准"按钮,因此无法提供我的调试密钥.

However, if I try to link a 2nd app with the same package, I CANNOT apply another SHA1 fingerprint, since the Approval button does not appear, and thus cannot provide my debug key.

对此有帮助吗?

这篇关于Android游戏排行榜在测试时被打破的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆