Google Play游戏服务 - 登录失败(OAUTH2:UNREGISTERED_ON_API_CONSOLE) [英] Google Play Games Service - Login Failed (OAUTH2: UNREGISTERED_ON_API_CONSOLE)

查看:5516
本文介绍了Google Play游戏服务 - 登录失败(OAUTH2:UNREGISTERED_ON_API_CONSOLE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在尝试实施Google Play游戏服务登录我的Android应用程序。到目前为止,我已经遇到了很多麻烦,但看起来我正在接近实际工作。



问题:
当我按下登录时,登录函数返回以下错误:

  02-18 12:31:51.122 5524-21263 /? W / Auth:[GetToken] GetToken失败,状态码为:UNREGISTERED_ON_API_CONSOLE 
02-18 12:31:51.128 5206-5723 /? E / TokenRequestor:您有错误的OAuth2相关配置,请检查。详细错误:UNREGISTERED_ON_API_CONSOLE
02-18 12:31:51.144 5206-32272 /? W / GamesServiceBroker:客户端连接到SDK 8487000,服务10298230和游戏39080030

到目前为止已完成:



我试图尽可能地遵循文档,但无论是我做错了什么或它是一种一塌糊涂。我猜在某个地方,我犯了一个错误。


$ b 我的清单文件包含以下内容:

 < meta-data android:name =com.google.android.gms.games.APP_ID
android:value =@ string / app_id/>
< meta-data android:name =com.google.android.gms.version
android:value =@ integer / google_play_services_version/>

我有一个games-ids.xml文件,其中包含用于高分和成就的App-ID和ID。



我的gradle

  apply插件:'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion23.0.3

defaultConfig {
applicationId com.duke.privatpc.quiztest
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName1.0
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}


dependencies {
编译fileTree(dir:'libs',include:['* .jar'])
编译项目(':BaseGameUtils')
testCompile'junit:junit:4.12'
compile'c​​om.android.support:appcompat-v7:23.1.1'
}

这包括从入门页面下载的BaseGameUtils。



我在Google Play开发者控制台设置了游戏,并添加了创建的App-ID。 b
$ b

我总是使用自己的密钥库来创建apk以及创建App-ID。有没有必要在任何时候使用debug.keystore?



正如您在这里看到的,SHA1是相同的,并显示正确的APP-ID。 p>


  1. APK SHA1

  2. 开发者控制台SHA1

我真的不知道我做错了什么。我还启动了测试并输入了我的电子邮件地址。

另外,点击我的登录按钮时绝对没有任何反应。没有Google Overlay弹出,我不确定这是不是已经很奇怪了?



我希望有人能帮助我,因为我没有发现任何问题可以帮助我,对于像我这样的业余程序员来说,这有点令人沮丧。



谢谢!

解决方案

您在哪里为您的应用创建了 OAuth 2.0 客户端?从您的屏幕截图看来,这是 Google API控制台中的条目。

您是否还在 Google Play开发者控制台的游戏服务部分创建了一个条目(请参阅 Google文档)?由于我在 Google API控制台中手动创建了 OAuth 2.0 客户端,而没有在当前游戏中遇到大问题在 Google Play开发者控制台中和两个控制台中的 OAuth 2.0 ID都不匹配。根据 video from <只应在 Google Play开发者控制台中创建code> Google Developers OAuth 2.0 客户端。我在这篇文章中写了更多关于我做错了什么的文章。


At the moment I'm trying to implement Google Play Games Services Sign In to my android app. I already had a lot of trouble so far, but it seems I', coming closer to it actually working.

The Problem: When i press login, the sign-in function returns the following error:

02-18 12:31:51.122 5524-21263/? W/Auth: [GetToken] GetToken failed with status code: UNREGISTERED_ON_API_CONSOLE
02-18 12:31:51.128 5206-5723/? E/TokenRequestor: You have wrong OAuth2 related configurations, please check. Detailed error: UNREGISTERED_ON_API_CONSOLE
02-18 12:31:51.144 5206-32272/? W/GamesServiceBroker: Client connected with SDK 8487000, Services 10298230, and Games 39080030

What I've done so far:

I tried to follow the documentation as good as possible, but either I'm doing something wrong or it is kind of a mess. I guess somewhere, i made a mistake.

My Manifest file includes this:

<meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="@string/app_id" />
<meta-data android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version"/>

I have a games-ids.xml file including the App-ID and ID's for highscores and achievements.

My gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.duke.privatpc.quiztest"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':BaseGameUtils')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
}

This includes the BaseGameUtils downloaded from the Getting Started Page.

I set up the Game at the Google Play Developer Console and added the created App-ID.

I always used my own keystore for creating the apk and also for creating the App-ID. Is there any need to use the debug.keystore at any point?

As you can see here, the SHA1 are identical and the correct APP-ID is shown.

  1. APK SHA1
  2. Developer Console SHA1

I honestly have no idea what I'm doing wrong. I also activated testing and entered my email adress.

Also, absolutely nothing happens when clicking my sign-in button. There is no Google Overlay popping up, I'm not sure if this is already weird?

I hope someone can help me, as I didn't find any questions that could help me and it's getting a bit frustrating for an amateur-programmer like me.

Thanks!

解决方案

Where did you create the OAuth 2.0 client for your app? From your screenshot it seems that this is the entry in the Google API console.

Did you also create an entry in the Game services section in the Google Play Developer console (see step 2 in the Google documentation)? I had big problems with my current game, because I created the OAuth 2.0 client manually in the Google API console and not in the Google Play Developer console and the OAuth 2.0 IDs in both consoles didn't match. According to a video from Google Developers OAuth 2.0 clients should only be created in the Google Play Developer console. I wrote more about what I did wrong in this post.

这篇关于Google Play游戏服务 - 登录失败(OAUTH2:UNREGISTERED_ON_API_CONSOLE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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