Google Play Services: Unable to sign in (SdkboxPlay)

I think I’ve followed this guide very well, although even though I tried various troubleshooting, PluginSdkboxPlay::signin() still fails with the following error messages:

(my platform first: [ / ] means I have tried those combinations)
Win10 x64
cocos2d-x v3.13.1
-m release -p android --ap android 23/15 --app-abi armeabi/armeabi-v7a
ndk r10e/r12b/+r13
galaxy s7 v6.0.1

adb logcat *:E

11-03 20:03:51.269 11896 31951 E GameAgent: Unable to retrieve application <13-digit-application-id> from network
11-03 20:03:51.269 11896 31951 E GameAgent: Application <13-digit-application-id> is not associated with package my-package-name. Check the application ID in your manifest.
11-03 20:03:51.279 31566 31566 E LoadGame: Unable to load metadata for game

So it looks like “app is not associated with package my-package-name”… Well I did everything I think I needed to and I checked my manifest app id 10 times as well.

I made sure,

  • I have my application linked at the Game Services panel at the Developer Console with the appropriate SHA-1 key from a release keystore

  • the sdkboxplay installer succeeded, things like parts of the AndroidManifest.xml modified:
    <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
    .
    +strings.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">my-app-name</string>
    <string name="app_id">13-digit-client-id</string>
</resources>
  • I was logged in on an email that whitelisted as set in the google developer console.

  • I called sdkbox::PluginSdkbox::init() at app start

  • Checked the rest of the manual steps of the sdkbox patching (.java files, permissions, etc.)

  • Checked the google troubleshooting pages (https://developers.google.com/games/services/android/troubleshooting)

I also set up a listener, that receives a onConnectionStatusChanged(int) with a parameter sdkbox::GPS::DISCONNECTED when the aforementioned error message on the console happens. Can you help please what would be the next step in the diagnosis?

I assume you replaced real app id with <13-digit-client-id>

So if you’re sure your package id and app-id are correct, double check for duplicates in AndroidManifest.xml

Thank you for helping. Yes, everywhere I use “my” is real parameter, here is my full manifest, I do not see any duplicate tags.

<?xml version='1.0' encoding='UTF-8'?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="my-package-name" android:installLocation="auto" android:versionCode="1" android:versionName="1.0">
    <uses-sdk android:minSdkVersion="15" />
    <uses-feature android:glEsVersion="0x00020000" />
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <meta-data android:name="android.app.lib_name" android:value="cocos2dcpp" />
        <activity android:configChanges="orientation|keyboardHidden|screenSize" android:label="@string/app_name" android:name="org.cocos2dx.cpp.AppActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
        <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
        <activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:name="com.google.android.gms.ads.AdActivity" android:theme="@android:style/Theme.Translucent" />
    </application>
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
</manifest>

Try building in debug and not release. I believe Google use different servers for unpublished/debug builds, and your app needs to be live on the store to connect to the release servers.

Well I will try that, ty.

I’m getting the the same error messages with the debug version (after linking a debug version of the app on the dev console with the debug certificate) ;(

Okay, progress has been done. Now it works with both debug and release.
I added another email of mine to the list of testers and now it logs me in automatically on that new email ( !! even though when I opened the Play Games app (before or after), it shows that I’m logged in on the older email address…)

The question arises, is there an additional place where one can set which g+ account is active at the time of login on the device?

EDIT:
Important thing to remember: add the email address you are already logged in with on google play, else you cannot sign in from you game. (add all possible email addresses to the alpha tester white list on dev console is the easiest so sign in should always succeed while testing)

You can set the specific account to log in with on the device itself. If you have multiple accounts added to the device, I thinks it’s under Play Games(App) -> Settings -> Choose the account -> use this account to login, or something similar to that. It’s in the Play Games App anyway.