I'm going nuts – I have been trying to fix this error for three days now, but no luck. This repo is full of examples of people hitting error 12501, but, unfortunately, every fix I read about doesn't work for me.
This wasn't working on my work project, so I decided to try it on this repo's example, and encountered what I believe to be the same issue. Check out my example repo at https://github.com/felipap/react-native-google-signin. My modifications are in the examples/ folder.
Delete local ~/.android folder in order to start from scratch.
git-clone this repo locally. Install node libraries by running yarn.
Open the example/android folder on Android Studio and make adjustments to make Gradle happy (I had to change the project's Gradle version to 4.4, for instance). This will create a ~/.android folder.
Try to run project. This should fail but at least it will create a debug.keystore file you need inside the ~/.android folder.
Start a new Firebase Android app with the name com.googlesigninsampleapp and SHA1 that you find by running keytool -exportcert -keystore ~/.android/debug.keystore -list -v.
Enable Google as a Sign In method. The Webclient Id field in the dialog that shows up in this step is the webClientId, which you need to set in one config.js file, inside the example project folder.
Run ./node_modules/.bin/react-native run-android.
Click the sign in button. Choose your account.
BAAMMM!

(Forgive me if I might have forgotten a couple of steps.)
(You can also check this at https://github.com/felipap/react-native-google-signin)
"dependencies": {
"react": "16.6.0-alpha.8af6728",
"react-native": "0.57.4",
"react-native-google-signin": "file:../"
},
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
googlePlayServicesAuthVersion = "16.0.1"
}
I'm having the same issue, were you able to fix this?
For what it's worth logcat shows (app name changed):
E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account:
pxm: Long live credential not available.
Okay, solved my own problem—I wasn't logged into Google Play on the emulator. The real problem is that the library shouldn't return "cancelled" in this scenario but something more meaningful like "not logged in" so that we can surface the correct error message to the user. Or am I missing something?
Thanks, @petestatic, that was exactly my problem!
hey @felipap, can this be reopen? It seems we’re still getting this incorrect error for this case
@oferRounds done!
Thank you @felipap!
hello, we're just passing the error that we get from the native to JS, so changing the error message is beyond our reach. Sorry.
Most helpful comment
Okay, solved my own problem—I wasn't logged into Google Play on the emulator. The real problem is that the library shouldn't return "cancelled" in this scenario but something more meaningful like "not logged in" so that we can surface the correct error message to the user. Or am I missing something?