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); }