谷歌Play游戏服务整合失败,"玩游戏的回调表明连接失败&QUOT。 [英] Google Play Game Services integration fails with "Play Games callback indicates connection failure."

查看:1704
本文介绍了谷歌Play游戏服务整合失败,"玩游戏的回调表明连接失败&QUOT。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经集成谷歌游戏服务使用NDK我游戏中的极简主义code的例子。

在启动应用程序时,身份验证失败的日志:

  V / GamesNativeSDK(7212):玩游戏的回调指示连接失败。
I / GamesNativeSDK(7212):需要连接到谷歌播放用户界面交互。
I / TeapotNativeActivity(7212):登录完成了的结果-3
I /双翼(7212):OnAuthActionFinished
I /双翼(7212):您还没有登录!
I / TeapotNativeActivity(7212):取回所有阻塞
I / TeapotNativeActivity(7212):------------------------------------------- -------------------
I / TeapotNativeActivity(7212):取回所有非阻塞
I / TeapotNativeActivity(7212):------------------------------------------- -------------------
I / TeapotNativeActivity(7212):业绩响应状态:-3

我进行在线文档中列出的所有步骤,包括:


  • 创建一个游戏服务在谷歌Play开发者控制台和链接两个应用程序。

  • 关联应用与调试键

  • 与释放键连接器应用程序

  • 接过APP-ID与吸烟有关的应用程序(同一ID为首尾相连的应用程序),并把它放在RES /价值/ ids.xml

  • 创建排行榜,并把它们的ID在res /价值/游戏ids.xml

  • 标签添加到我的Andr​​oidManifest.xml与NAME =com.google.android.gms.games.APP_ID和值=@字符串/ APP_ID

  • 游戏服务应用程序下载最新的更新。

  • 上市自己作为测试用户。

我不知道这消息是原始错误,而这是一种症状。
连接失败或需要互动的用户界面。

请注意,在控制台中,这两个关联的应用被列为开发者可以发布了。

源$ C ​​$ C我用的是从c ++ code例子StateManager.cpp的逐字复制,并在我的android_main我抄例如code片段,以及:

  // GPG-CPP:在这里,我们创建身份验证操作的回调
自动回调= [&放大器;(GPG :: AuthOperation运算,GPG :: AuthStatus状态){
    LOGI(OnAuthActionFinished);
    如果(IsSuccess(状态)){
        LOGI(你登录了!);
    }其他{
        LOGI(您还没有登录!);
    }
    //engine.animating = 1;
};如果(语句>!savedState = NULL)
{
    //我们开始了previous保存的状态;从中恢复。
    engine.state = *(结构saved_state *)语句> savedState;
    LOGI(恢复状态);
}
其他
{
    LOGI(没有保存的状态恢复。);
    GPG :: AndroidPlatformConfiguration platform_configuration;
    platform_configuration.SetActivity(语句>活动 - GT&; clazz所);
    //现在,创建游戏服务(见StateManager.cpp),并通过回调
    :: StateManager的InitServices(platform_configuration,NULL,回调);
}


解决方案

所以,事实证明,这种行为的目的是:
自动登录(在服务启动),都应该,如果你从来没有在登录之前要失败的。

您需要首先做一个用户发起登录,使用:

  game_services _-> StartAuthorizationUI();

...在随后的汽车登录将获得成功。

另外请注意,有很多在控制台上的错误,这似乎并没有与谷歌玩游戏服务的正常运作干涉的。

  E / GamesNativeSDK(12369):在异常的Dalvik /系统/ DexClassLoader.loadClass:抛出java.lang.ClassNotFoundException:找不到类com.google.android.gms.games在路径上.NativeSdkEntryPoints:DexPathList [zip文件\"/data/data/com.steenriver.Biplane/app_.gpg.classloader/4da25210572e7e07ea67142ded62c42e.jar\"],nativeLibraryDirectories=[/vendor/lib, /系统/ lib目录]。
W / dalvikvm(12369):无法解析LCOM /谷歌/安卓/ GMS /普通/ API / D的超类; (148)
W / dalvikvm(12369):类链接LCOM /谷歌/安卓/ GMS /普通/ API / D;'失败
I / dalvikvm(12369):找不到方法com.google.android.gms.common.api.d.a,从方法com.google.android.gms.common.api.GoogleApiClient $ Builder.gl引用
W / dalvikvm(12369):VFY:无法解析静态方法3084:LCOM /谷歌/安卓/ GMS /普通/ API /天; .A(Landroid /支持/ V4 /应用/ FragmentActivity;)LCOM /谷歌/安卓/克/普通/ API /天;
D / dalvikvm(12369):VFY:在更换运code 0x71为0x0002
W / dalvikvm(12369):VFY:找不到签名中引用的类(Landroid /支持/ V4 /应用/ FragmentActivity;)
E / dalvikvm(12369):找不到类的android.support.v4.app.FragmentActivity,从法com.google.android.gms.common.api.GoogleApiClient $ Builder.enableAutoManage引用
W / dalvikvm(12369):VFY:无法解决入住投149(Landroid /支持/ V4 /应用/ FragmentActivity;)在LCOM /谷歌/安卓/ GMS /普通/ API / GoogleApiClient $生成器;
D / dalvikvm(12369):VFY:在更换运code为0x1F×0010

最后一点:奇怪的是,我也看到了努力没有网络连接登录时错误需要用户互动

I have integrated Google Game Services with my NDK game using the minimalist code example.

When starting the app, the authentication fails with this in the logs:

V/GamesNativeSDK( 7212): Play Games callback indicates connection failure.
I/GamesNativeSDK( 7212): UI interaction required to connect to Google Play.
I/TeapotNativeActivity( 7212): Sign in finished with a result of -3
I/biplane ( 7212): OnAuthActionFinished
I/biplane ( 7212): You are not logged in!
I/TeapotNativeActivity( 7212): Fetching all blocking
I/TeapotNativeActivity( 7212): --------------------------------------------------------------
I/TeapotNativeActivity( 7212): Fetching all nonblocking
I/TeapotNativeActivity( 7212): --------------------------------------------------------------
I/TeapotNativeActivity( 7212): Achievement response status: -3

I've performed all the steps outlined in the online documentation, including:

  • Created a game service in Google Play Developer Console and linked two apps.
  • Linked app with Debug key
  • Linker app with Release key
  • Took the app-id from linked apps (same id for both linked apps) and put it in res/values/ids.xml
  • Created leaderboards, and put their IDs in res/values/game-ids.xml
  • Added tag to my AndroidManifest.xml with name="com.google.android.gms.games.APP_ID" and value="@string/app_id"
  • Downloaded latest update of Game Services app.
  • Listed myself as test user.

I am not sure which message is the original error, and which is a symptom. "Connection Failure" or "UI Interaction required".

Note that in the Developer Console, the two linked apps are listed as 'Ready to publish.'

The source code I use is a verbatim copy of StateManager.cpp from the c++ code examples, and in my android_main I have copied the example code snippet as well:

// gpg-cpp:  Here we create the callback on auth operations
auto callback = [&](gpg::AuthOperation op, gpg::AuthStatus status) {
    LOGI("OnAuthActionFinished");
    if (IsSuccess(status)) {
        LOGI("You are logged in!");
    } else {
        LOGI("You are not logged in!");
    }
    //engine.animating = 1;
};

if (state->savedState != NULL)
{
    // We are starting with a previous saved state; restore from it.
    engine.state = *(struct saved_state*)state->savedState;
    LOGI("Restored state");
}
else
{
    LOGI( "No saved state to restore." );
    gpg::AndroidPlatformConfiguration platform_configuration;
    platform_configuration.SetActivity(state->activity->clazz);
    // Now, create the game service (see StateManager.cpp) and pass in callback
    StateManager::InitServices(platform_configuration, NULL, callback);
}

解决方案

So, it turns out that this behaviour is intended: Auto logins (upon service start) are supposed to fail if you have never logged in before.

You need to do a user initiated login first, with:

game_services_->StartAuthorizationUI();

...before subsequent auto logins will succeed.

Also note that there are a lot of errors on the console, which do not seem to interfere with the proper functioning of the google play game service.

E/GamesNativeSDK(12369): Exception in dalvik/system/DexClassLoader.loadClass: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.games.NativeSdkEntryPoints" on path: DexPathList[[zip file "/data/data/com.steenriver.Biplane/app_.gpg.classloader/4da25210572e7e07ea67142ded62c42e.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]].
W/dalvikvm(12369): Unable to resolve superclass of Lcom/google/android/gms/common/api/d; (148)
W/dalvikvm(12369): Link of class 'Lcom/google/android/gms/common/api/d;' failed
I/dalvikvm(12369): Could not find method com.google.android.gms.common.api.d.a, referenced from method com.google.android.gms.common.api.GoogleApiClient$Builder.gl
W/dalvikvm(12369): VFY: unable to resolve static method 3084: Lcom/google/android/gms/common/api/d;.a (Landroid/support/v4/app/FragmentActivity;)Lcom/google/android/gms/common/api/d;
D/dalvikvm(12369): VFY: replacing opcode 0x71 at 0x0002
W/dalvikvm(12369): VFY: unable to find class referenced in signature (Landroid/support/v4/app/FragmentActivity;)
E/dalvikvm(12369): Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.google.android.gms.common.api.GoogleApiClient$Builder.enableAutoManage
W/dalvikvm(12369): VFY: unable to resolve check-cast 149 (Landroid/support/v4/app/FragmentActivity;) in Lcom/google/android/gms/common/api/GoogleApiClient$Builder;
D/dalvikvm(12369): VFY: replacing opcode 0x1f at 0x0010

One last note: Strangely, I've also seen the 'user interaction required' error when trying to login without a network connection.

这篇关于谷歌Play游戏服务整合失败,"玩游戏的回调表明连接失败&QUOT。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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