Unity玩游戏服务认证失败 [英] Unity play game service authenticate fail

查看:796
本文介绍了Unity玩游戏服务认证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从
下载玩游戏统一插件 https:// github .com / playgameservices / play-games-plugin-for-unity



并运行Android设备中的MainScene
$ b $然后点击验证按钮,并弹出谷歌播放对话框。



终于Social.localUser.authenticated始终是false。



然后我在下面的场景中绘制调试信息:

 创建平台特定的Play游戏客户端
创建真实IPlayGamesClient
进入状态:ShutdownState
ShutdownState.OnStateEntered:默认为无操作。
启动Auth Transition.Op SIGN_IN状态ERROR_NOT_AUTHORIZED
PlayGamesHelperObject.OnApplicationPause True
PlayGamesHelperObject.OnApplicationPause False
PlayGamesHelperObject.OnApplicationPause True
PlayGamesHelperObject.OnApplicationPause False
调用用户回调游戏线程

我尝试使用这些方法修复下面的
但我不能仍然登录成功


Method1在google play游戏控制台中,
添加测试用户和活动alpha测试版。



Method2在unity中创建android密钥库并签名

密钥库是一个签名文件,用于签名您的apk。当您创建开发版本时,Unity不会签署apk。



您的项目只需要一个Keystore文件。该文件是您的签名。创建一个这样做:



在发布设置中,选中Create New Keystore框。浏览并选择要存储文件的位置。它应该在某个地方,因为它与你的项目没有什么关系。



设置文件的保护密码并确认它。



从密钥别名下拉列表中选择创建新密钥。



打开一个窗口,您必须填写个人数据组织/人员。顶部的别名只是密钥库的名称。如果你有多个身份,确保你选择一个有意义的名字。您需要设置密钥库密码。请注意,这与上面的保护密码不同。据我所知他们可以是相同的,但为了安全起见,你应该使用两种不同的方法。如果你还没有把密码写在一张纸上;)

点击创建密钥生成密钥库文件。



要使用密钥库进行签名,您必须:

选中Use Existing Keystore框。



点击浏览并选择您的密钥库文件。



输入您的保护密钥。

在下面的字段中输入别名密码



确保您设置了别名您的Android Market许可RSA公钥处于发布设置的底部。您必须从您的Google市场帐户中获取公钥。



现在创建您的APK文件,并使用您的身份签名。



Method3有人提到这些代码对他们来说是成功的

  PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()。 
//。EnableSavedGames()
Build();

PlayGamesPlatform.InitializeInstance(config);

  PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()。 
.EnableSavedGames()
Build();
PlayGamesPlatform.InitializeInstance(config);

Method4我也做了这些检查

1.Android设置对话框中的应用程序ID与Play游戏机控制台中的应用程序ID相匹配( https:// play.google.com/apps/publish

2. Play游戏机控制台中的链接应用程序包名称与播放器设置/其他设置/软件包标识符



3.您登录的用户在Play游戏机中添加为测试人员



所以我卡在这里,我不知道为什么不能成功验证。 解决方案



请确保以下内容相同

1.apk's sha1



2.Google Developers Console OAuth Android sha1


$ b 3.GooglePlay Developer Console链接Google APIOAuth2客户端ID设置


I download play games unity plugin from https://github.com/playgameservices/play-games-plugin-for-unity

and run MainScene in android device

then click "Authenticate" button ,and popup google play dialog..

finally Social.localUser.authenticated is always false.

then I draw debug info in the scene below:

Createing platform-specific Play Games client
Creating real IPlayGamesClient
Entering state:ShutdownState
ShutdownState.OnStateEntered:Defaulting to no-op.
Starting Auth Transition.Op SIGN_IN status ERROR_NOT_AUTHORIZED
PlayGamesHelperObject.OnApplicationPause True
PlayGamesHelperObject.OnApplicationPause False
PlayGamesHelperObject.OnApplicationPause True
PlayGamesHelperObject.OnApplicationPause False
Invoking user callback on game thread

I try these methods to fix below, but I can't still login successfully

Method1 In the google play game console, add test user and active alpha,beta test.

Method2 In the unity,to create android keystore and signing

The keystore is a signature file that is used to sign your apk. When you create development builds Unity will not sign the apk.

You only need one Keystore file for your projects. The file is your signature. To create one do this:

In the publishing settings check the "Create New Keystore" box.

Click browse and choose a location where you want to store the file. It should be somewhere central since it's not really related to your project.

Set a protection password for the file and confirm it.

Select "Create a new key" from the "Key Alias" dropdown.

A window should open which you have to fill with your personal data about your organisation / person. The alias at the top is just a name of the keystore. If you have multiple identities make sure you choose a meaningful name. You need to set a keystore password. Note this is not the same as the protection password above. As far as i know they can be the same, but for security you should use two different. If you haven't write the passwords onto a sheet of paper ;)

Click "Create Key" to generate your keystore file.

To use a keystore for signing you have to:

Check the "Use Existing Keystore" box.

Click browse and select your keystore file.

enter your protection key.

select your desired identity from the alias dropdown.

enter the alias password in the field below

Make sure you have set your Android Market Licensing RSA Public Key at the bottom of the publishing settings. The public key has to be acquired from your Google market account.

Now create your APK file and it will be signed with your identity.

Method3 someone metioned these code is successful for them

PlayGamesClientConfiguration config = new  PlayGamesClientConfiguration.Builder().
    //.EnableSavedGames()     
    Build();

PlayGamesPlatform.InitializeInstance(config);

or

 PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().
        .EnableSavedGames()     
        Build();
 PlayGamesPlatform.InitializeInstance(config);

Method4 I also do these check

1.Application ID in the "Android Setup" dialog matches the application ID in the Play Games Console (https://play.google.com/apps/publish)

2.The linked application package name in the Play Games Console matches the bundle id in Player Settings / Other Settings/ Bundle Identifier

3.The user that you are logging in as is added as a tester in the Play Games Console

So I stuck here,I don't know why can't authenticate sucessfully.

解决方案

I fix my issue.

Make sure these below are the same

1.apk's sha1

2.Google Developers Console OAuth Android sha1

3.GooglePlay Developer Console link Google API "OAuth2 client ID" setting

这篇关于Unity玩游戏服务认证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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