我在Unity项目中启用了Google Play游戏插件。 Unity版本是5.3.4f1。谷歌玩游戏插件版本为0.9.32。我已成功登录我项目中的Google Play游戏服务。提交分数后,当我尝试查看排行榜时,它在日志中显示如下错误:
04-29 09:58:53.537: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:58:53 +05:30 DEBUG: Entering internal callback for AndroidPlatformConfiguration#InternalIntentHandler
04-29 09:58:53.537: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
04-29 09:58:53.575: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:58:53 +05:30 DEBUG: Application is pausing, which disconnects the RTMP client. Leaving room.
04-29 09:58:53.575: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
04-29 09:58:55.940: D/GamesUnitySDK(6910): Forwarding OnActivityResult
04-29 09:58:55.963: D/GamesUnitySDK(6910): Forwarding OnActivityResult Finished
04-29 09:58:55.999: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:58:55 +05:30 DEBUG: Showing UI Internal callback: ERROR_NOT_AUTHORIZED
04-29 09:58:55.999: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
04-29 09:58:56.077: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:58:56 +05:30 DEBUG: Invoking user callback on game thread
04-29 09:58:56.077: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
04-29 09:58:56.085: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:58:56 +05:30 DEBUG: Received UI callback: ERROR_NOT_AUTHORIZED
04-29 09:58:56.085: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
04-29 09:59:54.185: I/Unity(6910): [Play Games Plugin DLL] 04/29/16 9:59:54 +05:30 DEBUG: Application is pausing, which disconnects the RTMP client. Leaving room.
04-29 09:59:54.185: I/Unity(6910): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
我收到这样的错误
DEBUG:收到的UI回调:ERROR_NOT_AUTHORIZED
我也已成功登录,但仍然显示为未经授权的错误。这是我的代码。
using GooglePlayGames;
using GooglePlayGames.BasicApi;
public class GooglePlayGameService : MonoBehaviour {
void Start()
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.RequireGooglePlus()
.Build();
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
Social.localUser.Authenticate((bool Success)=>{
if(Success)
{
mStatusText = "Welcome " + Social.localUser.userName;
Debug.Log("Success Google Play Games");
}
else
{
mStatusText = "Authentication failed.";
//ShowNextScene ();
Debug.Log("failed Google Play Games");
}
});
}
}
public void ShowScoreBoard()
{
Debug.Log("User Authenticated: " + Social.localUser.authenticated);
if (Social.localUser.authenticated)
((PlayGamesPlatform)Social.Active).ShowLeaderboardUI("leaderboard id here");
}
当我检查用户是否经过身份验证时,它在我调试时返回true。但排行榜没有出现。有人可以帮我解决这个错误。提前致谢。
答案 0 :(得分:-1)
如果在Builder()中使用了 EnableSavedGames(),那么您需要在 切换 SavedGames 支持>开发者控制台,并在“ API控制台项目”中启用云端硬盘API 。触及所有这些的地方将是开发者控制台中的“游戏详情”页面。
确保您的计算机上没有多个debug.keystore
和开发者控制台上的SHA1和构建应该是相同的