Google Play游戏服务:ERROR_NOT_AUTHORIZED,用于Beta版本。 [Unity3d] [GooglePlayGamServices] [英] Google Play Games Service : ERROR_NOT_AUTHORIZED, when rollout for Beta. [Unity3d] [GooglePlayGamServices]

查看:885
本文介绍了Google Play游戏服务:ERROR_NOT_AUTHORIZED,用于Beta版本。 [Unity3d] [GooglePlayGamServices]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google Play游戏服务:SIGN_IN状态:ERROR_NOT_AUTHORIZED,适用于Beta版。
此外: -

  W验证:[GetToken] GetToken失败,状态码为:UNREGISTERED_ON_API_CONSOLE 
E TokenRequestor:您有错误的OAuth2相关配置,请检查。详细错误:UNREGISTERED_ON_API_CONSOLE

如果我从Unity构建并直接运行,一切正常。
但是当我推出一个测试版时,它显示Sign In Google绿盒子里有一个加载循环(然后帐户 - >选择beta测试者电子邮件),然后什么都没有。



使用:


  • GooglePlayGamesPlugin-0.9.38a

  • unity 5.6.03
  • >
  • 更新了sdk组件rev 40,rev 51



我做过的事情: -


  1. 创建一个新的应用程序谷歌播放控制台

  2. 添加了apk,进行了测试,然后进行了产品推广。 $ b
  3. 稍后,我在新更新中添加了玩游戏服务,并进行了测试版发布。

  4. note - 所有apk,卷展栏使用相同的密钥存储和包名称。 b
  5. Google Play控制台 - >发布管理 - >应用签名:上传
    证书SHA1与Google API相同 - >项目 - >客户ID
    Android SHA1

玩游戏设置: -




  • 测试版电子邮件:打开

  • 游戏保存数据:关闭

  • 测试电子邮件:添加电子邮件
  • 为Alpha和Beta进行测试:同时打勾(绿色)

  • / b>



      05-23 12:55:44.400 28917 29002 I GamesNativeSDK:Auth操作开始:登录

    05-23 12:55:44.400 28917 29002 I GamesNativeSDK:连接到Google Play ...

    05-23 12:55:44.522 28917 28948 W Unity:!!! [Play Games Plugin DLL] 05/23/17 12:55:44 +05:30警告:创建新的PlayGamesPlatform

    05-23 12:55:44.522 28917 28948 W Unity:

    05-23 12:55:44.522 28917 28948 W Unity:(文件名:./artifacts/generated/common/runtime/DebugBindings.gen.cpp行:51)

    05-23 12:55:44.522 28917 28948 W Unity:

    05-23 12:55:44.522 28917 28948 I Unity:[玩游戏插件DLL] 05/23/17 12:55:44 +05: 30 DEBUG:激活PlayGamesPlatform。

    05-23 12:55:44.523 28917 28948 I Unity:[玩游戏插件DLL] 05/23/17 12:55:44 +05:30 DEBUG:PlayGamesPlatform激活:GooglePlayGames.PlayGamesPlatform

    05-23 12:55:44.523 28917 28948我的Unity:[玩游戏插件DLL] 05/23/17 12:55:44 +05:30调试:创建平台特定的Play游戏客户端。

    05-23 12:55:44.523 28917 28948 I Unity:[玩游戏插件DLL] 05/23/17 12:55:44 +05:30调试:创建Android IPlayGamesClient客户端

    05-23 12:55:44.523 28917 28948 I Unity:[玩游戏插件DLL] 05/23/17 12:55:44 +05:30调试:启动Auth Transition。 Op:SIGN_IN状态:ERROR_NOT_AUTHORIZED

    05-23 12:55:44.523 28917 28948 I Unity:[玩游戏插件DLL] 05/23/17 12:55:44 +05:30 DEBUG:调用回调,AuthState从silentPending更改为Unauthenticated。

    05-23 12:55:44.523 28917 28948我的Unity:[玩游戏插件DLL] 05/23/17 12:55:44 +05:30调试:有待处理的auth回调 - 开始AuthUI

    C#代码:

     使用UnityEngine; 
    使用GooglePlayGames;
    使用GooglePlayGames.BasicApi;
    使用UnityEngine.SocialPlatforms;

    公共类PlayGameManger:MonoBehaviour {

    公共静态PlayGameManger实例{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);


    $ b $ public void SignIn(){
    if(isLogedIn == false){
    Social.localUser.Authenticate(success => {
    isLogedIn =成功;
    //Debug.Log(\"Signin:+ success);
    });
    }
    }
    //成就和其他代码
    }

    Help,
    谢谢:)

    解决方案

    现在一切正常。
    由于启用了Google应用签名功能,无法使用,我想我们必须对Google Play游戏服务的AndroidManifest.xml进行一些更改才能运行
    请参阅此处: - < href =https://support.google.com/googleplay/android-developer/answer/7384423 =nofollow noreferrer> https://support.google.com/googleplay/android-developer/answer/7384423
    但下面给出的解决方案也可以正常工作。



    [求助]



    我做了什么: - b / b
    $ b


    1. Google Play控制台 - >选择您的应用 - >发布管理 - >应用程序签名 - >应用程序签名证书:复制SHA-1(不复制单词'SHA1:')

    2. .developers.google.com /rel =nofollow noreferrer> https://console.developers.google.com/ ,选择您的项目 - >证书 - > OAuth 2.0客户端ID - >编辑OAuth客户端 - >签名证书指纹 - >用复制的SHA1 - >保存替换旧的SHA1。


    3. 打开你的游戏,你应该登录 - >电子邮件选择 - >选择测试人员的电子邮件。 Google Play游戏服务现在应该可以正常运行。



    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
    

    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.

    Using :-

    • GooglePlayGamesPlugin-0.9.38a
    • unity 5.6.03
    • sdk components updated rev 40 , rev 51

    Things i did :-

    1. Created a new application google play console
    2. added apk, made beta and then production rollout.
    3. later i added play game services in new update , made beta rollout.
    4. note - all apk , rollout use same keystore and package name.
    5. Google Play Console -> Release Management -> App signing : Upload certificate SHA1 is same as Google API -> Project -> Client ID for Android SHA1

    Play game settings :-

    • Beta tester Emails : Open
    • game save data : off
    • Testing emails : emails added
    • testing for Alpha and Beta : both tick (green)

    Following log :

    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# Code :

         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
     }
    

    Help, thanks :)

    解决方案

    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.

    [SOLVED]

    What i did :-

    1. Google Play Console -> Select your app -> Release Management -> App signing -> App signing certificate : copy SHA-1 (dont copy word 'SHA1:')

    2. 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.

    3. open you game, you should get sign in -> email selection -> select testers email. Google Play Games Services should work fine now.

    这篇关于Google Play游戏服务:ERROR_NOT_AUTHORIZED,用于Beta版本。 [Unity3d] [GooglePlayGamServices]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆