google-signin: GoogleSignin.signIn() never returns/resolves

No promise is resolved (neither rejected) after picking user from the user list.

Steps to Reproduce

  • Click Google Sign in button
  • User picker comes up (or doesn’t come up after the second try)
  • Pick a user

Link to a GitHub repository with code that reproduces the bug: https://github.com/zbettenbuk/jitsi-meet/tree/google-auth (The code is in react/features/recording/components/LiveStream/GoogleSignInForm.native.js, webClientId and google-services.json are excluded)

Documentation is here: https://github.com/zbettenbuk/jitsi-meet/tree/google-auth/doc

Accessing the Google Sign in feature: Start a conference (enter any name in the top field), then “…” menu -> Start live stream

Expected Behavior

Currently only logging of the successful sign in is expected

Actual Behavior

User picker screen disappears and the GoogleSignin.signIn() promise never gets resolved (neither rejected). If I click the Sign in button again, the promise gets rejected with Error: cannot set promise - some async operation is still in progress

There is an exception in the log though:

Could not set socket write timeout: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Native Method)
	at com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms@12521024@12.5.21 (040700-189987672):13)
Caused by: android.system.ErrnoException: setsockopt failed: EBADF (Bad file descriptor)
	at libcore.io.Linux.setsockoptTimeval(Native Method)
	at libcore.io.ForwardingOs.setsockoptTimeval(ForwardingOs.java:175)
Could not set socket write timeout: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Native Method)
	at com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms@12521024@12.5.21 (040700-189987672):13)
Caused by: android.system.ErrnoException: setsockopt failed: EBADF (Bad file descriptor)
	at libcore.io.Linux.setsockoptTimeval(Native Method)
	at libcore.io.ForwardingOs.setsockoptTimeval(ForwardingOs.java:175)

Environment

Please provide the version of your

  • react-native 0.55.4
  • react-native-google-signin 1.0.0-rc2
  • react 16.3.1
  • cocoapods and GoogleSignIn pod version (if applicable)
  • gradle 4.4, android plugin for gradle 3.1.2, and play-services-auth version (if applicable)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 33 (7 by maintainers)

Most upvoted comments

For future reference:

I had a similar issue when started using google-signin. Posted bellow is the stack trace of the error that happened when the sign in button was clicked. Close to the end of the exception is possible to see that the issue was related to the signing of the APK. I looked up for UNREGISTERED_ON_API_CONSOLE to find the solution. The issue was that the SHA-1 of the release variant wasn’t in the google-services.json file, only the debug variant SHA-1 was there.

I followed these steps and that fixed the issue for me.

I am currently using com.android.support:appcompat-v7:27.0.2, some people reported errors with the version 27.1.0. I’m not sure if this is related to the problem.

08-25 13:35:10.928 23811 23811 I AppCompatDelegate: Failed to instantiate custom view inflater androidx.appcompat.app.AppCompatViewInflater. Falling back to default.
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: java.lang.ClassNotFoundException: androidx.appcompat.app.AppCompatViewInflater
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at java.lang.Class.classForName(Native Method)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at java.lang.Class.forName(Class.java:453)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at java.lang.Class.forName(Class.java:378)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.support.v7.app.AppCompatDelegateImpl.a(:com.google.android.gms@12874041@12.8.74 (100400-204998136):1)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.support.v7.app.AppCompatDelegateImpl.onCreateView(:com.google.android.gms@12874041@12.8.74 (100400-204998136):1)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at com.android.internal.policy.DecorView.onResourcesLoaded(DecorView.java:1885)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:2599)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2672)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2071)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.ActivityTransitionState.setEnterActivityOptions(ActivityTransitionState.java:160)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.Activity.performCreate(Activity.java:7144)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.Activity.performCreate(Activity.java:7127)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.os.Handler.dispatchMessage(Handler.java:106)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.os.Looper.loop(Looper.java:193)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at android.app.ActivityThread.main(ActivityThread.java:6669)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at java.lang.reflect.Method.invoke(Native Method)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.appcompat.app.AppCompatViewInflater" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/system/framework/com.android.media.remotedisplay.jar", zip file "/system/framework/com.android.location.provider.jar", zip file "/data/app/com.google.android.gms-Up8WbwBAKxYByb82WLd6VQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.google.android.gms-Up8WbwBAKxYByb82WLd6VQ==/lib/arm64, /data/app/com.google.android.gms-Up8WbwBAKxYByb82WLd6VQ==/base.apk!/lib/arm64-v8a, /system/lib64]]
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
08-25 13:35:10.928 23811 23811 I AppCompatDelegate: 	... 30 more
08-25 13:35:10.990   761   761 D android.hardware.power@1.2-service.wahoo-libperfmgr: LAUNCH OFF
08-25 13:35:10.999  1174  1219 I ActivityManager: Displayed com.google.android.gms/.common.account.AccountChipAccountPickerActivity: +103ms (total +171ms)
08-25 13:35:12.028 23811 23832 D OpenGLRenderer: endAllActiveAnimators on 0x7213aaea00 (ListView) with handle 0x7213bde120
08-25 13:35:12.127 16788 17101 W Conscrypt: Could not set socket write timeout: java.lang.reflect.InvocationTargetException
08-25 13:35:12.140 16788 16803 I .gms.persisten: Background concurrent copying GC freed 333349(25MB) AllocSpace objects, 15(700KB) LOS objects, 41% free, 33MB/57MB, paused 79us total 155.722ms
08-25 13:35:12.147 16788 17101 W Conscrypt: 	at java.lang.reflect.Method.invoke(Native Method)
08-25 13:35:12.147 16788 17101 W Conscrypt: 	at com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms@12874041@12.8.74 (100400-204998136):13)
08-25 13:35:12.147 16788 17101 W Conscrypt: Caused by: android.system.ErrnoException: setsockopt failed: EBADF (Bad file descriptor)
08-25 13:35:12.147 16788 17101 W Conscrypt: 	at libcore.io.Linux.setsockoptTimeval(Native Method)
08-25 13:35:12.147 16788 17101 W Conscrypt: 	at libcore.io.ForwardingOs.setsockoptTimeval(ForwardingOs.java:174)
08-25 13:35:12.157 16788 17101 W Conscrypt: Could not set socket write timeout: java.lang.reflect.InvocationTargetException
08-25 13:35:12.157 16788 17101 W Conscrypt: 	at java.lang.reflect.Method.invoke(Native Method)
08-25 13:35:12.157 16788 17101 W Conscrypt: 	at com.google.android.gms.org.conscrypt.Platform.setSocketWriteTimeout(:com.google.android.gms@12874041@12.8.74 (100400-204998136):13)
08-25 13:35:12.157 16788 17101 W Conscrypt: Caused by: android.system.ErrnoException: setsockopt failed: EBADF (Bad file descriptor)
08-25 13:35:12.157 16788 17101 W Conscrypt: 	at libcore.io.Linux.setsockoptTimeval(Native Method)
08-25 13:35:12.157 16788 17101 W Conscrypt: 	at libcore.io.ForwardingOs.setsockoptTimeval(ForwardingOs.java:174)
08-25 13:35:12.168   608  1224 W SurfaceFlinger: Attempting to set client state on removed layer: com.google.android.gms/com.google.android.gms.common.account.AccountChipAccountPickerActivity#0
08-25 13:35:12.169   608  1224 W SurfaceFlinger: Attempting to destroy on removed layer: com.google.android.gms/com.google.android.gms.common.account.AccountChipAccountPickerActivity#0
08-25 13:35:12.317 23811 23811 W AccountChipsFragment: Recording consent failed.
08-25 13:35:12.326 16788 16788 W ChimeraUtils: Non Chimera context
08-25 13:35:12.340  1174  1213 I ActivityManager: Start proc 28167:com.google.android.gms.learning/u0a22 for service com.google.android.gms/.learning.training.background.TrainingGcmTaskService
08-25 13:35:12.326 16788 16788 W ChimeraUtils: Non Chimera context
08-25 13:35:12.353 28167 28167 E id.gms.learnin: Not starting debugger since process cannot load the jdwp agent.
08-25 13:35:12.384 28167 28167 I id.gms.learnin: The ClassLoaderContext is a special shared library.
08-25 13:35:12.387 28167 28167 I chatty  : uid=10022 com.google.android.gms.learning identical 1 line
08-25 13:35:12.390 28167 28167 I id.gms.learnin: The ClassLoaderContext is a special shared library.
08-25 13:35:12.398 16788 17101 W Auth    : [GetToken] GetToken failed with status code: UNREGISTERED_ON_API_CONSOLE
08-25 13:35:12.400 22824 22915 E TokenRequestor: You have wrong OAuth2 related configurations, please check. Detailed error: UNREGISTERED_ON_API_CONSOLE
08-25 13:35:12.427 23811 23811 W AutoManageHelper: Unresolved error while connecting client. Stopping auto-manage.
08-25 13:35:12.478 28004 28024 D FA      : Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=SignInHubActivity, firebase_previous_id(_pi)=7656383062663495933, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=7656383062663495932}]
08-25 13:35:12.516 22824 28073 V FA-SVC  : Logging event: origin=auto,name=screen_view(_vs),params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=SignInHubActivity, firebase_previous_id(_pi)=7656383062663495933, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=7656383062663495932}]
08-25 13:35:12.517 28004 28024 V FA      : Activity resumed, time: 1209975896```

@vonovak: my experience is that it does not fail every time. Sometimes it seems to work, and can even work repeatedly. But when it fails, it’s wedged until the app is reinstalled.