SDKBOX Play plugin fails on Android

SDKBOX Play plugin fails on Android
0

I’ve been trying to add the SDKBOX Play plugin to work on Android for several days, but nothing happens when I try to show the Achievements.
Logs show:

 E SignInAuthenticator: **** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES
 E SignInAuthenticator: **** This is usually caused by one of these reasons:
 E SignInAuthenticator: **** (1) Your package name and certificate fingerprint do not match
 E SignInAuthenticator: ****     the client ID you registered in Developer Console.
 E SignInAuthenticator: **** (2) Your App ID was incorrectly entered.
 E SignInAuthenticator: **** (3) Your game settings have not been published and you are
 E SignInAuthenticator: ****     trying to log in with an account that is not listed as
 E SignInAuthenticator: ****     a test account.
 E SignInAuthenticator: ****
 E SignInAuthenticator: **** To help you debug, here is the information about this app
 E SignInAuthenticator: **** Package name         : org.cocos2dx.cocosv4_SDKBOX
 E SignInAuthenticator: **** Cert SHA1 fingerprint: 7...
 E SignInAuthenticator: **** App ID from manifest : 718695189001
 ...
 W SignInActivity: ==> Returning non-OK result: 10002
 ...
 E AbstractServiceBroker: Getting service failed
 ...
 E AbstractServiceBroker: java.lang.NullPointerException: Account cannot be null.

I’m pretty sure that the package name is correct, and the app ID and SHA1 is the same as I have on the Developer Console.

I’m using cocos2d-x v4.0.

Created a new project from scratch, and published the game services as instructed on the plugin page.

These were the steps I followed:

  1. on CMakeLists.txt added

     if(ANDROID)
     	 	add_definitions(-DSDKBOX_ENABLED)
         	add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/PluginSdkboxPlay/)
         	target_link_libraries(${APP_NAME} ext_PluginSdkboxPlay)
         	add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/proj.android/app/jni/sdkbox)
         	target_link_libraries(${APP_NAME} ext_sdkbox)
     	endif()
    
  2. on the appdelegate.cpp added sdkbox::PluginSdkboxPlay::init();
    and on the HelloWorldCpp.cpp ->
    sdkbox::PluginSdkboxPlay::signin();
    sdkbox::PluginSdkboxPlay::showachievements

  3. Resources-> sdkbox_config.json with the leaderboard and achievements ID

  4. manifest XML, added


    and

  5. added the App ID to strings.xml on \proj.android\app\res\values

  6. copied PluginSdkboxPlay.jar and sdkbox.jar to proj.android/app/libs

  7. copied PluginSdkboxPlay and pluginsdkbox folders to JNI

  8. on proj.android\app\src\org\cocos2dx\cpp\AppActivity.java added the SDKBOX activity

  9. on app/build.gradle had to set minifyEnabled and shrinkResources to false, otherwise I was getting the error: SdkboxPlay: failed to get configuration

added to the dependencies:

implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.google.android.exoplayer:exoplayer-core:2.8.4'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.8.4'
implementation 'com.google.android.gms:play-services-base:15.0.0'
implementation 'com.google.android.gms:play-services-drive:15.0.0'
implementation 'com.google.android.gms:play-services-games:15.0.0'
implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-gcm:15.0.0'
implementation 'com.google.android.gms:play-services-analytics:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'

also tried with newer versions, but nothing changed…

  1. updated gradle version to com.android.tools.build:gradle:3.5.1

And I can see the signin to Google Play on the beginning of the game, but nothing happens when the showAchievements or showLeaderboards are called.

The Google alert the message, so there must be an issue there.

I suspect that this may be related to something around cocos2d-x v4.0

I have my game published and leaderboards working with 3.17
but on 4.0 build with the same code, configuration and keystore, gives me that errors

I guess the keystore is incorrect.

It’s not. I have just one release keystore. And confirmed the apk is signed with the SHA1 matching the one on google dev console.

Found the error!!! It’s some issue with the last version of the Play plugin itself.
By replacing the latest version of the PluginSdkboxPlay.jar with a older one, everything works again.
Three days lost because of this :frowning:

As soon as I try again to use the latest PluginSdkboxPlay.jar, the same google play error comes back:
SignInAuthenticator: **** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES

how about your cocos2d-x 3.x project with the last PluginSdkboxPlay ?

Can you share with us what is the exact version number of the old and last ‘PluginSdkboxPlay.jar’?

the latest version 2.5.1.2 (obtained from http://www.sdkbox.com/plugins/sdkboxplay) is not working.

The version that I’m using where it works is the one where PluginSdkboxPlay.jar size is 62 KB, from April 2018. Don’t know exactly the version number.

ok, thanks, we will look into this.

SDKBoxPlay sample prject for cocos2d-x v4