android ndk - Google Play Game Services integration fails with "Play Games callback indicates connection failure." -
i have integrated google game services ndk game using minimalist code example.
when starting app, authentication fails in logs:
v/gamesnativesdk( 7212): play games callback indicates connection failure. i/gamesnativesdk( 7212): ui interaction required connect google play. i/teapotnativeactivity( 7212): sign in finished result of -3 i/biplane ( 7212): onauthactionfinished i/biplane ( 7212): not logged in! i/teapotnativeactivity( 7212): fetching blocking i/teapotnativeactivity( 7212): -------------------------------------------------------------- i/teapotnativeactivity( 7212): fetching nonblocking i/teapotnativeactivity( 7212): -------------------------------------------------------------- i/teapotnativeactivity( 7212): achievement response status: -3
i've performed steps outlined in online documentation, including:
- created game service in google play developer console , linked 2 apps.
- linked app debug key
- linker app release key
- took app-id linked apps (same id both linked apps) , put in res/values/ids.xml
- created leaderboards, , put ids in res/values/game-ids.xml
- added tag androidmanifest.xml name="com.google.android.gms.games.app_id" , value="@string/app_id"
- downloaded latest update of game services app.
- listed myself test user.
i not sure message original error, , symptom. "connection failure" or "ui interaction required".
note in developer console, 2 linked apps listed 'ready publish.'
the source code use verbatim copy of statemanager.cpp c++ code examples, , in android_main have copied example code snippet well:
// gpg-cpp: here create callback on auth operations auto callback = [&](gpg::authoperation op, gpg::authstatus status) { logi("onauthactionfinished"); if (issuccess(status)) { logi("you logged in!"); } else { logi("you not logged in!"); } //engine.animating = 1; }; if (state->savedstate != null) { // starting previous saved state; restore it. engine.state = *(struct saved_state*)state->savedstate; logi("restored state"); } else { logi( "no saved state restore." ); gpg::androidplatformconfiguration platform_configuration; platform_configuration.setactivity(state->activity->clazz); // now, create game service (see statemanager.cpp) , pass in callback statemanager::initservices(platform_configuration, null, callback); }
so, turns out behaviour intended: auto logins (upon service start) supposed fail if have never logged in before.
you need user initiated login first, with:
game_services_->startauthorizationui();
...before subsequent auto logins succeed.
also note there lot of errors on console, not seem interfere proper functioning of 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 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): not find method com.google.android.gms.common.api.d.a, referenced method com.google.android.gms.common.api.googleapiclient$builder.gl w/dalvikvm(12369): vfy: unable 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 @ 0x0002 w/dalvikvm(12369): vfy: unable find class referenced in signature (landroid/support/v4/app/fragmentactivity;) e/dalvikvm(12369): not find class 'android.support.v4.app.fragmentactivity', referenced method com.google.android.gms.common.api.googleapiclient$builder.enableautomanage w/dalvikvm(12369): vfy: unable 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 @ 0x0010
one last note: strangely, i've seen 'user interaction required' error when trying login without network connection.
Comments
Post a Comment