【发布时间】:2019-09-30 21:29:34
【问题描述】:
Google Play 游戏服务:SIGN_IN 状态:ERROR_NOT_AUTHORIZED,推出测试版时。 还有这个:-
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 版时,它会显示带有加载圆圈的 Sign In Google 绿色框(然后是帐户 -> 选择 beta 测试者电子邮件),然后什么也没有。
使用:-
- GooglePlayGamesPlugin-0.9.38a
- 统一 5.6.03
- sdk 组件更新 rev 40 , rev 51
我做过的事情:-
- 创建了一个新的应用程序 google play 控制台
- 添加了 apk,进行了测试,然后进行了生产部署。
- 后来我在新更新中添加了玩游戏服务,推出了测试版。
- 注意 - 所有 apk 、推出使用相同的密钥库和包名称。
- Google Play 控制台 -> 发布管理 -> 应用签名:上传 证书 SHA1 与 Google API -> 项目 -> 客户端 ID 相同 Android 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
}
帮助, 谢谢:)
【问题讨论】:
-
嗨阿克沙伊。您是否浏览过其中一些帖子:GitHub、GitHub 2、StackOverflow - 看看他们是否尝试过您还没有尝试过的不同之处?该错误可能是由于某种控制台上的错误配置,因为您提到它在直接从统一运行时可以正常工作。
标签: c# android google-play-services