1

I am integrating google play games services with my flutter app. I used ElevatedButton(child: const Text('Sign In'),onPressed: () async {await GamesServices.signIn();},),. A pop-up opened, it made me download the Play Games app for the first time. Now whenever I tap on this button, a pop up opens and it starts loading and keeps on loading and throws an exception Unhandled Exception: PlatformException(error, Something went wrong Status{statusCode=unknown status code: 12501, resolution=null}, null, null) I have added correctly my app_id in the ids.xml file. Package name and SHA 1 key, both are the same in the google play console and in the firebase project.

E/Error   (29740): com.google.android.gms.common.api.ApiException: 4: 4: 
E/Error   (29740):  at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(com.google.android.gms:play-services-base@@17.4.0:4)
E/Error   (29740):  at com.google.android.gms.common.internal.zan.zaa(com.google.android.gms:play-services-base@@17.4.0:2)
E/Error   (29740):  at com.google.android.gms.common.internal.zap.onComplete(com.google.android.gms:play-services-base@@17.4.0:6)
E/Error   (29740):  at com.google.android.gms.common.api.internal.BasePendingResult.zab(com.google.android.gms:play-services-base@@17.4.0:177)
E/Error   (29740):  at com.google.android.gms.common.api.internal.BasePendingResult.setResult(com.google.android.gms:play-services-base@@17.4.0:136)
E/Error   (29740):  at com.google.android.gms.auth.api.signin.internal.zzk.zzc(com.google.android.gms:play-services-auth@@19.0.0:5)
E/Error   (29740):  at com.google.android.gms.auth.api.signin.internal.zzu.zzc(com.google.android.gms:play-services-auth@@19.0.0:6)
E/Error   (29740):  at com.google.android.gms.internal.auth-api.zzc.onTransact(com.google.android.gms:play-services-auth@@19.0.0:13)
E/Error   (29740):  at android.os.Binder.execTransact(Binder.java:739)
I/ExplicitSignIn(29740): Trying explicit sign in
D/ZrHung.AppEyeUiProbe(29740): stop checker.
W/ActivityThread(29740): handleWindowVisibility: no activity for token android.os.BinderProxy@e4a5ea9
D/ZrHung.AppEyeUiProbe(29740): notify runnable to start.
V/ActivityThread(29740): Skipping new config:{1.0 410mcc1mnc [en_GB] ldltr sw360dp w360dp h686dp 320dpi nrml long port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 0, 0) mAppBounds=Rect(0, 60 - 720, 1432) mWindowingMode=fullscreen mActivityType=undefined} nonFullScreen=0 suim:1 s.10}, config:{1.0 410mcc1mnc [en_GB] ldltr sw360dp w360dp h686dp 320dpi nrml long port finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 0, 0) mAppBounds=Rect(0, 60 - 720, 1432) mWindowingMode=fullscreen mActivityType=undefined} nonFullScreen=0 suim:1 s.10} for app:com.karmababies.gamepass
V/ActivityThread(29740): callActivityOnCreate
D/HiTouch_PressGestureDetector(29740): HiTouch on notch display, height corret:60
D/ActivityThread(29740): add activity client record, r= ActivityRecord{cb76306 token=android.os.BinderProxy@e4a5ea9 {com.karmababies.gamepass/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}} token= android.os.BinderProxy@e4a5ea9
D/ZrHung.AppEyeUiProbe(29740): notify runnable to start.
D/OpenGLRenderer(29740):   HWUI Binary is  enabled
D/HwAppInnerBoostImpl(29740): asyncReportData com.karmababies.gamepass,2,1,1,0 interval=973
D/ZrHung.AppEyeUiProbe(29740): stop checker.
W/HiTouch_HiTouchSensor(29740): depended package hiTouch does n't exist!
I/HiTouch_HiTouchSensor(29740): HiTouch restricted: system app HiTouch don't exist.
D/OpenGLRenderer(29740):   HWUI Binary is  enabled
I/ViewRootImpl(29740): jank_removeInvalidNode all the node in jank list is out of time
D/ZrHung.AppEyeUiProbe(29740): Current Activity:false
D/ZrHung.AppEyeUiProbe(29740): not watching, wait.
D/ZrHung.AppEyeUiProbe(29740): notify runnable to start.
D/ZrHung.AppEyeUiProbe(29740): restart watching
W/InputMethodManager(29740): startInputReason = 1
D/ZrHung.AppEyeUiProbe(29740): stop checker.
I/silentSignIn(29740): error
D/ZrHung.AppEyeUiProbe(29740): notify runnable to start.
E/flutter (29740): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(error, Something went wrong Status{statusCode=unknown status code: 12501, resolution=null}, null, null)
E/flutter (29740): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter (29740): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter (29740): <asynchronous suspension>
E/flutter (29740): #2      MethodChannelGamesServices.signIn (package:games_services_platform_interface/method_channel_games_services.dart:46:14)
E/flutter (29740): <asynchronous suspension>
E/flutter (29740): #3      GamesServices.signIn (package:games_services/games_services.dart:58:12)
E/flutter (29740): <asynchronous suspension>
E/flutter (29740): #4      _MyHomePageState.build.<anonymous closure> (package:game_pass/main.dart:44:32)
E/flutter (29740): <asynchronous suspension>
E/flutter (29740): 
W/InputMethodManager(29740): startInputReason = 1
D/ViewRootImpl[SignInHubActivity](29740): surface should not be released
D/ActivityThread(29740): Remove activity client record, r= ActivityRecord{cb76306 token=android.os.BinderProxy@e4a5ea9 {com.karmababies.gamepass/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}} token= android.os.BinderProxy@e4a5ea9
E/ion     (29740): [74]ioctl c0044901 failed with code -1: Invalid argument
E/ion     (29740): [74]ioctl c0044901 failed with code -1: Invalid argument
Sweta Jain
  • 1,884
  • 2
  • 14
  • 34
  • Have you added the apk in Play Store in alpha or beta? – Kaushik Chandru Mar 08 '22 at 00:25
  • Hope these links help you: https://stackoverflow.com/questions/33846801/error-12501-authenticating-with-google-sign-in?answertab=createdasc#tab-top, https://stackoverflow.com/questions/47632035/google-sign-in-error-12500?answertab=createdasc#tab-top. – My Car Mar 08 '22 at 03:50

1 Answers1

2

12501 is google auth error. It indicated that you are not providing all the needed info in order for android to authenticate or the info you are providing is incorrect.

According to the official documentation of the package you are using, in order to use it on Android, you need to add these lines to your manifest:

<meta-data
    android:name="com.google.android.gms.games.APP_ID"
    android:value="app_id" />

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

where app_id is the app id registered in google play console of your game(or app).

I am not sure the package is up to date because official Android docs regarding the issue is a bit different from the implementation inside the flutter package.

If you are doing everything as in here(it is written by the creator of the package) and it still is not working - it means the issue is inside the android implementation of the package.

If it is so - you have options either:

  1. contact the package creator and ask him to fix it,
  2. or fix it by yourself - as a flutter dev for several years now I can assure you it is a pretty common situation,
  3. or find another package that suits your needs.
  4. or write the implementation by yourself.

Maybe not very helpful but it is how it goes with custom user packages - a lot of them are unclear, incomplete or even unusable.

Pavlo Ostasha
  • 11,045
  • 7
  • 27
  • Thanks for the answer! I'll add one important thing: instead of using `android:name="com.google.android.gms.games.APP_ID" android:value="0123abcd"`, you _have_ to define the app id in a separate file and then link to the value with something like `android:value="@string/app_id"`. – filiph Mar 14 '22 at 12:13