问题
I made small app with GoogleSignIn (using React-Native, Firebase and Expo). I created my OAuth Client Id for Android (got sha1 using openssl rand -base64 32 | openssl sha1 -c and set package name host.exp.exponent), then I created my firebase web app: image and follow the instruction, my small code you can see hereenter code here (folder screens)
On local server when I run expo start (then I run on the Android emulator, Android Studio) everything works fine, the application logs in, Firebase receives login data, and in general, no errors. When I built my project (apk file) then I drag the file into the emulator, everything loads, I open the application and it opens, but when I click on the login button, nothing happen. I download LogCat on my emulator and there are some logs:
7-09 18:42:02.185 7912 7975 I ReactNativeJS: 'err:', { [Error: Please provide the appropriate client ID. See the documentation for more details https://docs.expo.io/versions/latest/sdk/google/#loginasync]
07-09 18:42:02.185 7912 7975 I ReactNativeJS: code: 'ERR_GOOGLE_CONFIG',
07-09 18:42:02.185 7912 7975 I ReactNativeJS: line: 112,
07-09 18:42:02.185 7912 7975 I ReactNativeJS: column: 244,
07-09 18:42:02.185 7912 7975 I ReactNativeJS: sourceURL: '/data/user/0/com.yourcompany.yourappname/files/38.0.0/cached-bundle-experience-%40dmitriykulikovskiy%2Fyour-app-slug1365844490-38.0.0' }
So I don't understand what's wrong with my client ID ... I followed this tutorial.
来源:https://stackoverflow.com/questions/62860618/why-googlesignin-works-on-local-server-but-doesnt-works-on-my-android