Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Can';t检索排行榜_Android_Google Play Services_Google Play Games_Leaderboard - Fatal编程技术网

Android Can';t检索排行榜

Android Can';t检索排行榜,android,google-play-services,google-play-games,leaderboard,Android,Google Play Services,Google Play Games,Leaderboard,我想在我的游戏中使用排行榜。我在开发者控制台中设置了游戏服务项目,构建了api客户端并连接到它。但当我尝试用以下代码检索排行榜时(我用我的排行榜id替换了实际id): 我收到以下错误: 05-18 17:25:04.330: E/Volley(1443): [149] BasicNetwork.performRequest: Unexpected response code 400 for https://www.googleapis.com/games/v1/leaderboards/my_l

我想在我的游戏中使用排行榜。我在开发者控制台中设置了游戏服务项目,构建了api客户端并连接到它。但当我尝试用以下代码检索排行榜时(我用我的排行榜id替换了实际id):

我收到以下错误:

05-18 17:25:04.330: E/Volley(1443): [149] BasicNetwork.performRequest: Unexpected response code 400 for https://www.googleapis.com/games/v1/leaderboards/my_leaderboard_id?language=ru_RU
05-18 17:25:04.330: E/LeaderboardAgent(1443): Unable to retrieve leaderboard my_leaderboard_id
05-18 17:25:04.330: E/LeaderboardAgent(1443): No instance found for leaderboard my_leaderboard_id for SOCIAL and ALL_TIME

05-18 17:25:04.373: E/AndroidRuntime(13891): java.lang.NullPointerException: Attempt to invoke interface method 'com.google.android.gms.games.Game com.google.android.gms.games.leaderboard.Leaderboard.getGame()' on a null object reference
因此,无法检索排行榜。但发布分数似乎效果不错(至少LogCat中没有错误消息):

还需要提到的是,我还没有发布游戏服务项目,所以它处于“准备测试”状态。但我的电子邮件在测试人员列表中,所以我想这一切都应该是好的。
有人知道这里有什么问题吗?

这是我的错,我错误地使用了我的游戏服务项目id而不是排行榜id。现在它起作用了

05-18 17:25:04.330: E/Volley(1443): [149] BasicNetwork.performRequest: Unexpected response code 400 for https://www.googleapis.com/games/v1/leaderboards/my_leaderboard_id?language=ru_RU
05-18 17:25:04.330: E/LeaderboardAgent(1443): Unable to retrieve leaderboard my_leaderboard_id
05-18 17:25:04.330: E/LeaderboardAgent(1443): No instance found for leaderboard my_leaderboard_id for SOCIAL and ALL_TIME

05-18 17:25:04.373: E/AndroidRuntime(13891): java.lang.NullPointerException: Attempt to invoke interface method 'com.google.android.gms.games.Game com.google.android.gms.games.leaderboard.Leaderboard.getGame()' on a null object reference
Games.Leaderboards.submitScore(mGoogleApiClient, LEADERBOARD_ID, score);