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 构建和运行,一切正常。 但是当我推出 Beta 时,它会显示带有加载圆圈的登录 Google 绿色框(然后是帐户 -> 选择 Beta 测试人员电子邮件),然后什么也没有。
使用:-
- GooglePlayGamesPlugin-0.9.38a
- 统一 5.6.03
- SDK 组件更新版本 40、版本 51
我做过的事情:-
- 创建了一个新的应用程序 google play console
- 添加了 apk,进行了测试,然后正式推出。
- 后来我在新更新中添加了玩游戏服务,并进行了测试。
- 注意 - 所有 apk 和 rollout 使用相同的 keystore 和包名称。
- Google Play 控制台 -> 发布管理 -> 应用签名:上传 证书 SHA1 与 Google API -> 项目 -> 客户端 ID 相同 安卓 SHA1
玩游戏设置:-
- Beta 测试人员电子邮件:打开
- 游戏保存数据:关闭
- 测试电子邮件:添加的电子邮件
- Alpha 和 Beta 测试:都打勾(绿色)
以下日志:
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
}
帮助, 谢谢:)
最佳答案
现在一切正常。 它由于启用了 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 游戏服务现在应该可以正常工作了。
关于c# - 推出 Beta 版时的 Google Play 游戏服务 : ERROR_NOT_AUTHORIZED,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44153675/