SDKBOX Play Crash on Sign in

SDKBOX Play Crash on Sign in
0

#1

Hello,
I’m currenly working on the android version, I’ve set everything like it’s shown in the docs.
i’m testing on release mode too.
When i try to sign in with sdkbox::PluginSdkboxPlay::signin();

The app crashes, here’s the logs :

D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mygames.game, PID: 1393
java.lang.IllegalArgumentException: Given String is empty or null
at com.google.android.gms.common.internal.zzbq.zzgv(Unknown Source)
at com.google.android.gms.auth.api.signin.GoogleSignInOptions$Builder.zzfc(Unknown Source)
at com.google.android.gms.auth.api.signin.GoogleSignInOptions$Builder.requestServerAuthCode(Unknown Source)
at com.google.android.gms.auth.api.signin.GoogleSignInOptions$Builder.requestServerAuthCode(Unknown Source)
at com.sdkbox.plugin.SdkboxGPGAuthentication$1.run(SdkboxGPGAuthentication.java:98)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

For the json config part:
“sdkboxplay”: {
“leaderboards”: [
{
“id”: “IDIDIDIDIDIDID”,
“name”: “ranking”
}
],
“connect_on_start”: false,
“show_achievement_notification”: true,
“cloud_save”: false,
“debug”: true
}


#2

java.lang.IllegalArgumentException: Given String is empty or null

did you have change google_app_id in res/strings.xml


#3

Yes i actually did.


#4

how to reproduce?


#5

I don’t know if this is reproducable. but I did almost everything like it should :

  • testing on release mode

  • I set up game services, added two linked apps (one for debug and the other for release and added their SHA1 keys)

  • added leaderboards/achievements

  • copied app id into the <string name=“google_app_id”>MY_ID</string> on strings as there’s <meta-data android:name=“com.google.android.gms.games.APP_ID” android:value="@string/google_app_id" /> on my manifest.xml

  • sdkbox play isSingedIn returns false.but just after I do signin() it crashes with the errors above. even with no internet it does crash.

  • after some digging. I even added GET_ACCOUNTS permission as it was not there. still it doesn’t work.

any suggestions please?


#6

which version coco2d-x you are test on?


#7

I’m running cocos3d-x v3.16.

I feel like this issue is due to not detecting the app id in manifest like you said. but there’s nothing I can do to solve this.


#8

UPDATE : I created a brand new V3.17 cocos2D-x project. Imported sdkbox play with SDKBOX Installer.
configured the manifest. and Signin() is always CRASHING the brand new project.

Can someone please try this with a new project as well. I don’t know if i’m doing something wrong or this is some serious bugg. this concerns Android for anyone trying to help.

@yinjimmy


#9

i tried cppTest317.

you can check follow points:

  1. modify ./proj.android/app/build.gradle
....

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':libcocos2dx')

    implementation 'com.google.android.gms:play-services-auth:12.0.1'
    implementation 'com.google.android.gms:play-services-drive:12.0.1'
    implementation 'com.google.android.gms:play-services-games:12.0.1'
}

  1. configure web_client_id in file ./Resources/sdkbox_config.json

{
    "android": {
        "sdkboxplay": {
            "web_client_id": "340534096218-goaafgmlsc8ut9730lae5kg2kh9m2i35.apps.googleusercontent.com" //here should fill your google app web client id
        }
    }
}
  1. remove ./cocos2d/cocos/platform/android/java/libs/android-support-v4.jar

  2. configure google_app_id in file ./proj.android/app/res/values/strings.xml

<resources>
    <string name="google_app_id">340534096218</string>
</resources>

#10

I tried your solution, but couln"t build the project. I was stuck with
transformDexArchiveWithExternalLibsDexMergerForDebug FAILED

tried to find a solution, everyone recommended to add multiDexEnabled true in default config, but it didn’t work.


#11

how about this https://stackoverflow.com/a/48531191/5443510 for multiDexEnabled


#12

Still same error :

What went wrong:
Execution failed for task ‘:LeagueChallenge:transformDexArchiveWithExternalLibsDexMergerForDebug’.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: P:\Project\proj.android\app\build\intermediates\transforms\dexBuilder\debug\0.jar,
P:\Project\proj.android\app\build\intermediates\transforms\dexBuilder\debug\1.jar,


P:\Project\proj.android\app\build\intermediates\transforms\dexBuilder\debug\87.jar

and here’s this too : Program type already present: com.google.android.gms.auth.api.Auth
I kind of believe this google auth is called somewhere else beside android-support-v4? and that’s what causing the issue?


#13

UPDATE :
I did update android studio and moved everything to target API 27. i’m not sure if I did anything else, but the crash report error changed.

08-22 17:53:49.149 6063-6063/com.games.mygame E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.games.mygame, PID: 6063
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.games.mygame/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1820)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1531)
at android.app.Activity.startActivityForResult(Activity.java:4403)
at android.app.Activity.startActivityForResult(Activity.java:4362)
at com.sdkbox.plugin.SdkboxGPGAuthentication$1.run(SdkboxGPGAuthentication.java:121)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

i’m not sure if this is same crash I had before, but maybe this will give you an idea about some new possible solution.

EDIT : it was actually the abscence of “web_client_id” in sdkbox json config that was causing the First crash (java.lang.IllegalArgumentException: Given String is empty or null).

  • To fix the new crash. I added : <activity
    android:name=“com.google.android.gms.auth.api.signin.internal.SignInHubActivity” /> into my androidmanifest.xml. Signin() is not crashing the app anymore. but it leads to another activity where the login dialog pops up. I wanted to stay at my current scene while the login dialogs popups without going to another activity.

  • Login is not working yet. but I guess that has something to do with my google configuration and it’s not code related.
    I will keep you updated.


#14

UPDATE:

I got the login dialog box popping on right now. but I can’t login. the callback always indicates connection status 1002. i made sure all configurations are correct. it tries to sign in. but fails. no profile info are showing on top.

I would also like to know why “web_client_id” was necessary in my case when the docs don’t even mention it.

> V/FA: Recording user engagement, ms: 15123
> V/FA: Connecting to remote service
> V/FA: Activity paused, time: 556827480
> D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=15123, firebase_screen_class(_sc)=AppActivity, firebase_screen_id(_si)=3381680337199132143}]
> V/MediaPlayer-JNI: setVolume: left 0.230000  right 0.230000
> V/MediaPlayer: MediaPlayer::setVolume(0.230000, 0.230000)
> W/FA: Failed to retrieve Firebase Instance Id
> V/FA: Connection attempt already in progress
> V/ActivityThread: performLaunchActivity: mActivityCurrentConfig={0 1.0 themeSeq = 0 showBtnBg = 0 604mcc2mnc [en_US,ar_MA] ldltr sw411dp w411dp h773dp 420dpi nrml long port ?dc finger -keyb/v/h -nav/h mkbd/h desktop/d s.665}
> V/MediaPlayer-JNI: pause
> V/MediaPlayer: pause
> V/MediaPlayer: message received msg=7, ext1=0, ext2=0
>                unrecognized message: (7, 0, 0)
>                callback application
>                back from callback
> V/FA: onActivityCreated
> V/FA: Connection attempt already in progress
>       Activity resumed, time: 556827532
> I/SemDesktopModeManager: registerListener: android.view.ViewRootImpl$3@eb9b6a3
> D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=AppActivity, firebase_previous_id(_pi)=3381680337199132143, firebase_screen_class(_sc)=SignInHubActivity, firebase_screen_id(_si)=3381680337199132147}]
> D/ViewRootImpl@fca9da0[SignInHubActivity]: ThreadedRenderer.create() translucent=true
> D/InputTransport: Input channel constructed: fd=131
> D/ViewRootImpl@fca9da0[SignInHubActivity]: setView = DecorView@42719ff[SignInHubActivity] touchMode=true
> W/FA: Failed to retrieve Firebase Instance Id
> V/FA: Connection attempt already in progress
> D/FA: Connected to remote service
> V/FA: Processing queued up service tasks: 4
> D/ViewRootImpl@fca9da0[SignInHubActivity]: dispatchAttachedToWindow
> V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 27
> V/FA: Activity paused, time: 556827538
> D/ViewRootImpl@fca9da0[SignInHubActivity]: Relayout returned: oldFrame=[0,0][0,0] newFrame=[0,0][1080,2220] result=0x27 surface={isValid=true -1198170112} surfaceGenerationChanged=true
>                                            mHardwareRenderer.initialize() mSurface={isValid=true -1198170112} hwInitialized=true
> D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000,  [1080x2220]-format:1
> V/MediaPlayer-JNI: getCurrentPosition: 134233 (msec)
> D/ViewRootImpl@fca9da0[SignInHubActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
> D/InputTransport: Input channel destroyed: fd=191
> D/ViewRootImpl@22b55d0[AppActivity]: Relayout returned: oldFrame=[0,0][1080,2220] newFrame=[0,0][1080,2220] result=0x1 surface={isValid=true -662392832} surfaceGenerationChanged=false
> D/ViewRootImpl@22b55d0[AppActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 63 - 0, 0) or=1
> D/ViewRootImpl@fca9da0[SignInHubActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 63 - 0, 0) or=1
> V/FA: Inactivity, disconnecting from the service
> D/ViewRootImpl@22b55d0[AppActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
> D/ViewRootImpl@fca9da0[SignInHubActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
> D/ViewRootImpl@fca9da0[SignInHubActivity]: MSG_WINDOW_FOCUS_CHANGED 1
> D/ViewRootImpl@fca9da0[SignInHubActivity]: mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true -1198170112}
> V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@7a991f6 nm : com.neatrex.leaguechallenge ic=null
> I/InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus
> D/InputTransport: Input channel constructed: fd=156
> D/ViewRootImpl@22b55d0[AppActivity]: MSG_WINDOW_FOCUS_CHANGED 1
>                                      mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true -662392832}
> D/Cocos2dxActivity: onWindowFocusChanged() hasFocus=true
> D/cocos2d-x debug info: connection status change: 1002

@yinjimmy @htlxyz


#15

release run ?


#16

yes that’s the release build.


#17

sorry, this is a bug, we fixed it, you can try staging, or wait next release.


#18

@Peatrex

i push a 3.17 sample project with sdkboxplay, you can have a try, or compare with yours.

we didn’t push cocos folder, you can link cocos2d-x-repo to cocos folder.


#19

I ran into the same problem in v3.17 stable release. What source code should i change to fix it?


#20

which problem? can you detail?

please use staging sdkbox import sdkboxplay --staging or sdkbox update --staging.

and , we provide a 3.17 sample proejct, take a look.