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:
-
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()
-
on the appdelegate.cpp added sdkbox::PluginSdkboxPlay::init();
and on the HelloWorldCpp.cpp ->
sdkbox::PluginSdkboxPlay::signin();
sdkbox::PluginSdkboxPlay::showachievements -
Resources-> sdkbox_config.json with the leaderboard and achievements ID
-
manifest XML, added
and -
added the App ID to strings.xml on \proj.android\app\res\values
-
copied PluginSdkboxPlay.jar and sdkbox.jar to proj.android/app/libs
-
copied PluginSdkboxPlay and pluginsdkbox folders to JNI
-
on proj.android\app\src\org\cocos2dx\cpp\AppActivity.java added the SDKBOX activity
-
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…
- 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.