I am currently working for a company where I need to access the People API from Google Cloud (for which I have set up OAuth) and also utilize Firebase's Analytics
I get this error:
google_sign_in plugin:PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException: 10: , null)
when I try to get access to the People API via OAuth.
This happens only when I specify the dependencies for google play services in the gradle
files (app and project level) [Check SDK Instructions for Firebase Android Project.].
gradle
files, this did solve the google_sign_in
issue but Firebase Analytics stopped working and I get this error:
Missing google_app_id. Firebase Analytics disabled. See shortened_link_that_I_cant_post
Right now I am stuck with using only one of the two services. I removed Firebase from my Project and my App from Firebase console for now.
if you have apply plugin: 'com.google.gms.google-services'
inside android/app/build.gradle
you comment this and it may solve the problem for you. I don't know if it will have a big effect on Firebase, but this solves the problem.
You can read the docs https://firebase.google.com/docs/projects/multiprojects
and search Deleting apply plugin: 'com.google.gms.google-services' from your app build.gradle
Update 1: I found if you add at first or replace in oauth_client
inside google-services.json
at client_id where client_type=3 with web platform Google cloud credentials oauth client id, you can keep apply plugin: 'com .google.gms.google-services'
, google services code will generate google service values.xml with default_web_client_id
attribute as your web client id, then this solves the problem.
Update 2: After reading google_sign_in carefully.
default_web_client_id
in file google-services
values. xml
. this solves the problem without changing google-services.json
or commentapply: 'com.google.gms.google-services'
client_id
where client_type
= 3 in oauth_client
in google-services.json
and not have to set serverClientId
Update 24/05/2023: if you need read idToken
when sign_in. You should to do Update 1