Google Play游戏服务:推出Beta版时出现ERROR_NOT_AUTHORIZED [英] Google Play Games Service : ERROR_NOT_AUTHORIZED, when rollout for Beta
问题描述
Google Play游戏服务:测试版推出时,SIGN_IN状态:ERROR_NOT_AUTHORIZED. 还有这个:-
Google Play Games Service : SIGN_IN status: ERROR_NOT_AUTHORIZED, when rollout for Beta. And also this :-
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 beta版的测试者电子邮件"),然后什么都没有.
If i Build and Run Directly from Unity , everything works fine. But When i Rollout a Beta, it shows Sign In Google green box with a loading circle (then accounts -> select beta tester Email), and then nothing.
使用:-
- GooglePlayGamesPlugin-0.9.38a
- 团结5.6.03
- sdk组件更新了第40版,第51版
我所做的事情:-
- 创建了一个新的应用程序Google Play控制台
- 添加了apk,进行了Beta测试,然后进行了产品发布.
- 后来我在新的更新中添加了玩游戏服务,并推出了Beta版.
- 注意-所有apk,推出都使用相同的密钥库和包名称.
- Google Play控制台->版本管理->应用签名:上传 证书SHA1与Google API->项目->的客户端ID相同 Android SHA1
- Created a new application google play console
- added apk, made beta and then production rollout.
- later i added play game services in new update , made beta rollout.
- note - all apk , rollout use same keystore and package name.
- Google Play Console -> Release Management -> App signing : Upload certificate SHA1 is same as Google API -> Project -> Client ID for Android SHA1
玩游戏设置:-
- 测试版电子邮件:打开
- 游戏保存数据:关闭
- 测试电子邮件:已添加电子邮件
- 测试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签名而无法正常运行,我想我们必须对AndroidManifest.xml进行一些更改才能使Google Play游戏服务正常工作 请参阅此处:- https://support.google.com/googleplay/android-developer/answer/7384423 但是下面给出的解决方案也可以正常工作.
Everything is working now. It was not working due to Google App Signing enabled, i guess we have to do some changes to AndroidManifest.xml for Google Play Games Services to work see here :- https://support.google.com/googleplay/android-developer/answer/7384423 but solution given below also works fine.
[已解决]
我做了什么:-
-
Google Play控制台->选择您的应用->版本管理->应用签名->应用签名证书:复制SHA-1(不要复制单词"SHA1:")
Google Play Console -> Select your app -> Release Management -> App signing -> App signing certificate : copy SHA-1 (dont copy word 'SHA1:')
打开 https://console.developers.google.com/,选择您的项目->凭据-> OAuth 2.0客户端ID->编辑OAuth客户端->签名证书指纹->用复制的SHA1->保存替换旧的SHA1.
open https://console.developers.google.com/ , select your project -> credentials -> OAuth 2.0 client IDs -> Edit OAuth client -> Signing-certificate fingerprint -> replace the old SHA1 with copied SHA1 ->save.
打开游戏,您应该登录->电子邮件选择->选择测试人员的电子邮件. Google Play游戏服务现在应该可以正常工作.
open you game, you should get sign in -> email selection -> select testers email. Google Play Games Services should work fine now.
这篇关于Google Play游戏服务:推出Beta版时出现ERROR_NOT_AUTHORIZED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!