我正在使用该BaseGameActivity课程连接谷歌玩游戏服务.问题是以某种方式认证不起作用.我在网上搜索了几个小时的解决方案,但没有找到任何有助于我解决问题的方法.
当我启动BaseGameActivity时,我在LogCat中获得以下输出:
03-19 14:22:36.126: W/GameHelper(15312): ****
03-19 14:22:36.126: W/GameHelper(15312): ****
03-19 14:22:36.126: W/GameHelper(15312): **** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES
03-19 14:22:36.126: W/GameHelper(15312): **** This is usually caused by one of these reasons:
03-19 14:22:36.126: W/GameHelper(15312): **** (1) Your package name and certificate fingerprint do not match
03-19 14:22:36.126: W/GameHelper(15312): **** the client ID you registered in Developer Console.
03-19 14:22:36.126: W/GameHelper(15312): **** (2) Your App ID was incorrectly entered.
03-19 14:22:36.126: W/GameHelper(15312): **** …Run Code Online (Sandbox Code Playgroud) java android google-api google-play-services google-play-games
我正在尝试在我的练习Android应用中使用Google Play游戏服务.
我按照开发人员指南中的说明获得了按钮UI.当我第一次点击登录时,它会引导我完成登录过程.在它即将完成该过程之后,它给我一个"未知错误"的对话框.在第一次之后,它总是在显示加载动画之后给我这个对话框.
我导入了BaseGameUtils和google-play-services_lib.我将BaseGameUtils的引用附加到google-play-services_lib.然后将这些2的参考文献附加到我的游戏项目中.
我导出项目以将SHA1放入开发人员控制台.然后我将我的12位数应用ID放在values/ids.xml上(获取应用程序下的元标记).
尝试清理项目,重做SHA1/keystore进程,没有运气.我的电子邮件正在进行测试访问.
我阅读并尝试了在这个问题上提供的解决方案,但这不是我的情况.
任何遇到相同或有任何人的人都应该尝试解决方案吗?
我正在努力使游戏API工作,参考https://github.com/playgameservices/android-samples/blob/master/BaseGameUtils/src/com/google/example/games/basegameutils/BaseGameActivity.java作为示例码.
我非常相似,基本上我正在尝试连接游戏客户端并收到否定答案.当尝试使用startResolutionForResult()来管理它时,这就是我得到的:
E/Volley(15638): [1492] il.a: Unexpected response code 403 for https://www.googleapis.com/games/v1/players/112370814111712506xxx
E/Volley(15638): [1492] il.a: Unexpected response code 403 for https://www.googleapis.com/games/v1/players/112370814111712506xxx
E/SignInIntentService(15638): Access Not Configured
[...]
E/LoadSelfFragment(15748): Unable to sign in - application does not have a registered client ID
Run Code Online (Sandbox Code Playgroud)
最后一条消息,"应用程序没有注册的客户端ID"让我想到了这个问题...但我不认为我的问题与应用程序ID /客户端ID有关,因为我在另一个上使用相同的API密钥机.我非常确定从当前机器的debug.keystore派生的SHA1正确性.
问题似乎与我正在使用的测试地址有关,奇怪的是我没有收到总是相同的回复:使用相同的键和设置,我有时得到:
E/SignInIntentService(15638): Access Not Configured
Run Code Online (Sandbox Code Playgroud)
甚至:
E/SignInIntentService(15638): Unable to load player
Run Code Online (Sandbox Code Playgroud)
我startResolutionForResult()在OnConnectionFailedListener中使用它,它会短暂显示登录屏幕,但随后会报告错误.
另一个奇怪的事情是调用了onActivityResult(),结果代码是10004
我无法理解的最后一件事是,在登录失败后,为了循环我的应用程序,一遍又一遍地调用onConnectionFailed()方法.相关代码是:
public void initClient() {
GamesClient.Builder gcBuilder = new GamesClient.Builder(this, cb, cf);
gcBuilder.setGravityForPopups(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
//gcBuilder.setScopes(mScopes);
mGamelient = gcBuilder.create();
mSchiacciameleView.setGameClient(gcBuilder.create()); …Run Code Online (Sandbox Code Playgroud)