Google Play游戏服务:SIGN_IN状态:ERROR_NOT_AUTHORIZED,推出Beta时。 还有: -
W Auth : [GetToken] GetToken failed with status code: UNREGISTERED_ON_API_CONSOLE
E TokenRequestor: You have wrong OAuth2 related configurations, please check. Detailed error: UNREGISTERED_ON_API_CONSOLE
如果我直接从Unity构建和运行,一切正常。 但是当我推出测试版时,它会显示带有加载圈的登录谷歌绿色框(然后是帐户 - >选择测试版测试人员电子邮件),然后什么都没有。
使用: -
我做的事情: -
玩游戏设置: -
关注日志:
05-23 12:55:44.400 28917 29002 I GamesNativeSDK: Auth operation started: SIGN IN
05-23 12:55:44.400 28917 29002 I GamesNativeSDK: Connecting to Google Play...
05-23 12:55:44.522 28917 28948 W Unity : !!! [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 WARNING: Creating new PlayGamesPlatform
05-23 12:55:44.522 28917 28948 W Unity :
05-23 12:55:44.522 28917 28948 W Unity : (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
05-23 12:55:44.522 28917 28948 W Unity :
05-23 12:55:44.522 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Activating PlayGamesPlatform.
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: PlayGamesPlatform activated: GooglePlayGames.PlayGamesPlatform
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Creating platform-specific Play Games client.
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Creating Android IPlayGamesClient Client
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Starting Auth Transition. Op: SIGN_IN status: ERROR_NOT_AUTHORIZED
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: Invoking callbacks, AuthState changed from silentPending to Unauthenticated.
05-23 12:55:44.523 28917 28948 I Unity : [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30 DEBUG: there are pending auth callbacks - starting AuthUI
C#代码:
using UnityEngine;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;
public class PlayGameManger : MonoBehaviour {
public static PlayGameManger Instance{ set; get;}
public bool isLogedIn;
void Awake () {
if (Instance == null) {
Instance = this;
isLogedIn = false;
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder ().Build();
PlayGamesPlatform.InitializeInstance (config);
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate ();
SignIn ();
DontDestroyOnLoad (gameObject);
} else {
Destroy (gameObject);
}
}
public void SignIn(){
if (isLogedIn == false) {
Social.localUser.Authenticate (success => {
isLogedIn = success;
//Debug.Log("Signin : "+success);
});
}
}
// Achievements and other code here
}
帮助, 谢谢:))
答案 0 :(得分:8)
现在一切正常。 由于启用了Google App Signing,无法正常工作,我想我们必须对AndroidManifest.xml进行一些更改才能让Google Play游戏服务工作 看到这里: - https://support.google.com/googleplay/android-developer/answer/7384423 但是下面给出的解决方案也可以正常工作。
[已解决]
我做了什么: -
Google Play游戏机 - >选择您的应用 - >发布管理 - >应用签名 - >应用签名证书:复制SHA-1(不要复制单词' SHA1:')
打开https://console.developers.google.com/,选择您的项目 - >凭证 - > OAuth 2.0客户端ID - >修改OAuth客户端 - >签名证书指纹 - >用复制的SHA1替换旧的SHA1 - >保存。
打开你的游戏,你应该登录 - >电子邮件选择 - >选择测试人员电子邮件Google Play游戏服务现在应该可以正常使用。