Cannot find GOOGLE appId for project : <projectid> - android

I'm implementing google authentication on firebase using the firebaseui lib.
Firebase is working properly, i can access the data in my database, and email/password auth is also working, although when i try to login using google i always get the same error :
W/AuthMethodPicker: Firebase sign in with credential unsuccessful
com.google.firebase.FirebaseException: An internal error has occured. [ Cannot find GOOGLE appId for project: 12345678. ]
at com.google.android.gms.internal.zzafg.zzes(Unknown Source)
at com.google.android.gms.internal.zzafd$zzg.zza(Unknown Source)
at com.google.android.gms.internal.zzafo.zzet(Unknown Source)
at com.google.android.gms.internal.zzafo$zza.onFailure(Unknown Source)
at com.google.android.gms.internal.zzafj$zza.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:453)
i know that this value is extracted from the json file and added as a resource property during build by com.google.gms.google-services plugin, so i checked and the property was in fact added but for some reason it seems that firebase is not able to read it at runtime..
Any idea about what i can be doing wrong?
thanks!

Before you generated your app's google-services.json, did you enable Google Sign In for your project?
https://developers.google.com/identity/sign-in/android/start-integrating

Make sure you have a Firebase project
In that project make sure you have enabled GOOGLE AUTHENTICATION
Now Download a fresh copy of the google-services.json and replace it with the old one inside your app folder

yes i enabled google auth before generating the json.
Another detail is descovered in the meantime if that google auth does work without firebase-ui.
What i did was to try their example of google auth (adding to my app source) and it worked without issues.
Adding firebase-ui seems to remove the need for some extra logic so i wanted to use it, but it seems i'm either missing something or there is a bug on firebase-ui .

Leaving this here for anyone that might encounter this issue now.
Had a similar problem to above only difference is i had it on iOS. Would try to launch and sign in through google and would get the same internal error.
What worked for me was enabling the identity kit on google API and then checking "Google" and the other providers I used. You can find this on the google cloud console -> API Manager -> Dashboard.
App restart, clean build and then everything worked.

Related

E/zzf: Problem retrieving SafetyNet Token: 7: Android

I have this error:
E/zzf: Problem retrieving SafetyNet Token: 7:
I am working on AndroidStudio with kotlin, the main problem is there is a captcha coming on everytime a I try to login via firebase phone auth.
Things done:
Added all keys in the firebase project (SHA-1, SHA-256 -- both debug and release)
Enabled Android Device Verification
And when implementation androidx.browser:browser:1.2.0 is removed, the following error shows up.
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/browser/customtabs/CustomTabsIntent$Builder;
I concluded, if E/zzf: Problem retrieving SafetyNet Token: 7: error is solved, all the other errors will be solved automatically.
Based upon error code 7 and your attempts so far, the client appears to be out-of-sync with the back-end. Make sure to download the current google-services.json and overwrite the existing one file in your project; then build again and it should work out. If it doesn't, also delete all build directories and Gradle caches. Hope that my common sense will count as "reputable source", because this is not really documented anywhere, except the default setup instructions.
I've even found some "reputable source":
Make sure that you only have this most recent downloaded config file in your app.
Register your App from the Firebase console for SafetyNet
Follow these steps
Open Firebase console
Navigate to project settings
Navigate to App Check and found Your apps section
Click on your App and add SafetyNet
Add SHA-256 certificate fingerprint
In Kotlin, I Solving this Error By Adding SHA-1 Key into the Firebase. Then after All the Errors are solved.
Open Android Studio
Select Gradle in Android Studio from right Panel.
Select Your App.
In Tasks -> android-> click on signing Report
It Will Automatic Generate SHA-1 Key.Add SHA-1 In Firebase Project Setting.
And Also I Add setActivity(this.requireActivity()) in sendVerificationCode() function.
`private fun sendVerificationCode(number: String) {
val options = PhoneAuthOptions.newBuilder(mAuth)
.setPhoneNumber(number)
.setTimeout(10L,TimeUnit.SECONDS)
.setActivity(this.requireActivity())
.setCallbacks(callback)
.build()
PhoneAuthProvider.verifyPhoneNumber(options)
}`

java.io.IOException: FIS_AUTH_ERROR in Android Firebase

I'm getting following error with Firebase services.
E/FirebaseInstanceId: Topic sync or token retrieval failed on hard failure exceptions: FIS_AUTH_ERROR. Won't retry the operation.
D/AndroidRuntime: Shutting down VM
com.google.android.gms.tasks.RuntimeExecutionException: java.io.IOException: FIS_AUTH_ERROR
at com.google.android.gms.tasks.zzu.getResult(Unknown Source:15)
at com.myApp.MainActivity$2.onComplete(MainActivity.java:349)
at com.google.android.gms.tasks.zzj.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7804)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
Caused by: java.io.IOException: FIS_AUTH_ERROR
at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid##20.1.0:82)
at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid##20.1.0:96)
at com.google.firebase.iid.zzx.then(com.google.firebase:firebase-iid##20.1.0:4)
at com.google.android.gms.tasks.zzd.run(Unknown Source:5)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Here is the part of the code where crash occurs:
FirebaseInstanceId.getInstance().getInstanceId().addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
#Override
public void onComplete(#NonNull Task<InstanceIdResult> task) {
if (task.getResult() != null && task.isSuccessful()) {
// Get new Instance ID token
firebaseToken = task.getResult().getToken();
prefs.edit().putString("firebaseToken", firebaseToken).apply();
registerToken();
}
}
});
The error occurs in onComplete. Here is firebase dependencies which I use:
// FIREBASE
implementation 'com.google.firebase:firebase-analytics:17.2.3'
implementation 'com.google.firebase:firebase-messaging:20.1.2'
implementation 'com.google.firebase:firebase-appindexing:19.1.0'
implementation 'com.google.firebase:firebase-ads:19.0.0'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
I found this issue on Github related with my crash but there is no conclusive solution at all. Does anybody encountered this kind of issue? Thanks in advance.
Note: I don't use Flutter however the error occurs without flutter too. Device is Samsung A51 with Android 10.
Note 2: Firebase removed firebase-core. Problem can be related with that.
All you have to do is just make the API key you are using has permission to the following APIs:
Firebase Installations API
Firebase Cloud Messaging API
FCM Registration API
Cloud Messaging
You can change the restrictions from your google cloud -> APIs & Services -> Credentials
All of a sudden the same error (FIS_AUTH_ERROR) appeared in one of my apps, where I use Firebase Cloud Messaging. Everything was working without any issues, and suddenly the app was not able to get the app/device token with getToken(). After hours of research I discovered something, which solved the problem for me. I decided to check the values in the file google-services.json to see if they match the corresponding parameters in the Firebase Console at the settings of my project. First I downloaded a brand new google-services.json, which I compared with the one I already had in my app's folder, and they both were simply the same without any difference. In the Firebase Console I was checking one by one the Project ID, the Project number, etc. When I got to the Web API Key its value looked quite similar to api_key from google-services.json, but still both values were different. Then I decided to edit the file, and in the place of api_key I've put the value from Web API Key. Then I've cleaned the project and rebuilt, and afterwards everything again started working just perfectly.
Update 08.2022
After more than a year later I can confirm that the above is still valid. Though I decided to check the key restrictions in Google Cloud Console following the advise of Ambrose Bako. Then I discovered that the mess with the different keys available in my account is even bigger.
The last key (Maps API key) is the one which gets into the Firebase file google-services.json. I've downloaded a fresh copy, and it is still the same, no change since then. Obviously this key has pretty tight restrictions, but it is intended to be used somewhere else (google maps flutter), and it works properly on its place.
Now guess what! The key which gets into Firebase as "Web API Key" is the first one - Android key (auto created by Firebase). I don't understand too much how different stuff is organized between Firebase and Google Cloud Console, but considering the name of the key, I though that the second one - Browser key (auto created by Firebase) - should find its place as "Web API Key" in Firebase.
Anyway in my particular case the Web API Key from Firebase worked properly in my google-services.json because it was actually the Android key which I needed. I'm writing all this because in some other cases it might not be exactly the same. So, if needed, one should look inside Google Cloud Console > APIs & Services > Credentials > API Keys, and take from there the right Android key (click on "SHOW KEY" on the right), then place it into the Firebase file google-services.json. Hope this can help.
Temporary but working solution. Just downgrade com.google.firebase:firebase-messaging:20.1.2 to com.google.firebase:firebase-messaging:20.1.0. Apperantly, there is some kind of bug in 20.1.1 and 20.1.2 versions. App doesn't crash anymore.
UPDATE (11.04.2020): I tested in com.google.firebase:firebase-messaging:20.1.5 and apperantly problem has been fixed.
UPDATE (26.04.2020):
I found a permanent solution. First upgrade firebase dependencies to com.google.firebase:firebase-messaging:20.1.6. After that download google-services.json from firebase. Replace it with the current one. After that build > clean project otherwise you can get
API key expired. Please renew the API key
error. There is no problem with the key, it's some kind of bug of Google. If you completed these steps, add following code into onCreate of your top Application class which is you declared in manifest at the application tag.
FirebaseOptions options = new FirebaseOptions.Builder()
.setApplicationId("APP ID") // Required for Analytics.
.setProjectId("PROJECT ID") // Required for Firebase Installations.
.setApiKey("GOOGLE API KEY") // Required for Auth.
.build();
FirebaseApp.initializeApp(this, options, "FIREBASE APP NAME");
You can found your app id in the firebase > project settings. Also if you're debugging, don't forget to add the debug SHA-256 key to firebase.
Now I don't get crash anymore. Firebase services work perfectly.
If you have recently changed google-services.json file, you need to remove build file of your project and rebuild the project.
update: I got this error when I was testing my app in debug mode. In release version it was solved and worked correctly.
https://stacklearn.ir/course/android-introductory-training-course
The FIS_AUTH_ERROR means Authentication for Firebase installation sdk has failed. If you use a service that depends on Firebase installation sdk (or FIS), you need a valid authorization.
According to Firebase cloud messaging v20.1.1 release note:
Apps that use the Firebase auto-initialization process and the Gradle plugin to convert google-services.json into resources are unaffected. However, apps that create their own FirebaseOptions instances must provide a valid API key, Firebase project ID, and application ID.
So if you (or a service using fcm added by you) uses FirebaseOptions, it has to pass some additional values for the FIS.
Solutions
Downgrade to v20.1.0 of firebase-messaging (Not recommended though. It's like running from the problem)
Provide additional keys if you use FirebaseOptions
I found a solution to this problem
1) in Android Studio , in left panel "Project" swich Android view to Project view
2) copy file google-services.json NOT into "app" folder (like it says in instruction) ... but copy this file into the upper root folder
and it will work
In addition to Steeve's answer, the Firebase Messaging credentials should be restricted to these 3 Selected APIs:
Firebase Cloud Messaging API
Firebase Installations API
FCM Registration API
Go to the credentials on Google Cloud Console (APIs & Services -> Credentials), Click on the relevant key and select the 3 APIs above.
If you restrict usage to your Android apps, make sure to add SHA-1 fingerprints for your specific app. If you use internal app sharing, make sure to also add the SHA-1 of the internal app bundle as described here.
The correct fix is to add "Firebase Installations API" to the restrictions of your Google API Key (see google-services.json).
In your Google Cloud console, it's in APIs & Services, then Credentials. Open the API Key is look at "Restrictions".
No need to recompile.
This is for sure, (if you finished all configuration) then version of firebase messaging is not compatible with other dependencies.
you can check dependencies here, my solution was to downgrade from implementation 'com.google.firebase:firebase-messaging:20.1.3' to implementation 'com.google.firebase:firebase-messaging:20.1.0'
#mahdi-malv, #ambrose-bako, #steeve are right.
Firebase Android SDK updates on February 27 (M65) and afterwards introduced a new infrastructure service, the Firebase Installations SDK which comes with a dependency on the Firebase Installations API.
Firebase Installations requires valid Firebase options API key, project ID, and application ID (a.k.a. "appId") in order to successfully communicate with Firebase servers.
Errors during communication with the Firebase Installations API indicate invalid Firebase options or misconfigurations regarding API keys.
To mitigate the issue
make sure that your application is using valid Firebase options from the latest google-services.json file from your Firebase console:
Firebase options: instructions and background.
If you use API restrictions, make sure that the API key used by your application is white-listed for the Firebase Installations API (and for your application):
API restrictions: instructions and background
Regarding Application restrictions: Either set the radio button to None or make sure that your app is white-listed (with the correct SHA-1 certificate).
For details, please visit:
https://firebase.google.com/support/privacy/init-options
Just in case, renamed the package name, deleted google-services.json,
and going into firebase checked firebase-database (read\write).
Then deleted the old package and its hash from the firebase project settings,
after adding a new package and hash, received a new google-services.json, after that everything worked
I think the error is that a package was specified in firebase but there was no hash
Hope this helps someone:
In my situation, I used self-signed ca.
So I need to use network-security-config.xml
After huge try and error, finally I add system directory in trust-anchors like below, FIS_AUTH_ERROR is gone and Firebase worked.
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config>
<trust-anchors>
<certificates src="system" /> <!-- for Firebase -->
<certificates src="user" /> <!-- for tooling. Ex:Charles -->
<certificates src="#raw/ca_1"/> <!-- my self-signed ca-->
</trust-anchors>
</base-config>
</network-security-config>
For me, it just was:
build > clean project
Because I was changing google-services.json file many times.
Maybe a bit late, but hopefully this info may help someone out there.
I had the problem too with firebase-messaging:21.0.1.
I followed all the instructions given in this thread, but nothing helped.
What was curious is that before the error E/FirebaseInstanceId: Topic sync or token retrieval failed on hard failure exceptions: FIS_AUTH_ERROR. Won't retry the operation
appeared the logcat showed Firebase Installations Service is unavailable.
After some investigation the solution was as follows.
I used a self-signed certificate on my dev-server and trusted it in my app as described here: https://developer.android.com/training/articles/security-ssl.html#CommonProblems
Somehow this broke the whole SSL handshake stuff in android and I couldn't authenticate to the Firebase Installations Service anymore.
After removing this and using plain http for my dev environment everything works again like a charm. (of course, for my prod server I'm using a ROOT trusted certificate, so no problems here)
I had fight with this exception almost 2 days, and now solved.
First make sure the restrictions API as mentioned Ambrose's answer
add ALL SHA-1 on firebase console and cloud console credential,
in my case I need 4 SHA-1, from:
debug keystore
release keystore
firebase distribution (if using .AAB )
release certified from playstore's signing like this:
I think add the last SHA-1 to cloud console make my app works nicely.
Hope this answer will help other.
Happy code!
I had the same problem when I redownloaded Android Studio on a new computer. I hadn't set up Google Play services in my SDK Tools, and my emulator didn't have the Google Play store. See this discussion https://github.com/firebase/firebase-android-sdk/issues/1286#issuecomment-951403455
Also note that FirebaseInstanceId requires Google Play services to
create a token and it will fail on devices without it.
After creating a new Emulator with Google Play and restarting my IDE, the problem was solved.
you need to add
apply plugin: 'com.google.gms.google-services'
implementation platform('com.google.firebase:firebase-bom:x.x.x')
implementation 'com.google.firebase:firebase-analytics'
to your app/build.gradle ,
these code will give to you when create google.services file on firebase console
To remove this line:
FirebaseApp.initializeApp(getApplicationContext());
and let the SDK auto-initialize with the google-services.json solved it for me.
it's very-very confused, how I search a soltion for this error (with FIS_AUTH_ERROR), but with #Andreas Rayo Kniep's answer, especially with CURL command test, I know what's wrong with my problem.
CURL command to test firebase conf :
curl -H "content-type: application/json" -d "{appId: 'YOUR-APP-ID', sdkVersion: 't:1'}" https://firebaseinstallations.googleapis.com/v1/projects/PROJECT-NAME/installations/?key=API-KEY;
I must change API key at google-services.json, because it's status : PERMISSION_DENIED, message : Requests from referer are blocked.
so I create new API key from google console, with restrict API for : Cloud Messaging, FCM Registration API, Firebase Cloud Messaging API, Firebase Installations API.
and application restriction : None.
and problem was fixed!
I use :
com.google.firebase:firebase-messaging:20.1.0
firebase_messaging: ^10.0.2
In my case Crashlytics reports this only on a few Samsung devices, I think this is something with how Google services are implemented on certain Samsung devices so there is not much you can do.
Best solution worked for me is upgrading dependencies and clean & re-build project
Tried all solutions above. They didn't work for me. But then I deleted the app from the device and installed again. This helped.
Method 1
Go to your google cloud console https://console.cloud.google.com/
Then choose your project and check auto-created by firebase token in credentials -> API keys. Select your key and check if there are any restrictions you have to configure. Clear the restrictions and again build your app newly.
Method 2
Check your fingerprints -> project settings -> in firebase console and cross check with your keystore file's fingerprint algorithms. Then download your new google-services.json file and replace it with your existing file in android/app
For me, I forgot we had implemented SSL pinning in the early stages of our app, so we had to download and trust the root Google Trust Services CA.
Thanks to this GitHub thread for reminding me to consider SSL pinning: https://github.com/invertase/react-native-firebase/issues/5522#issuecomment-884960850
I guess a good giveaway was that curl would work fine, but it would fail on Android.
I was getting this error when I installed the application on my phone. The emulator did not give an error. I tried almost every solution, but in my case it was enough to delete the application, compile and build it again. I realized this after 1 day
My dependencies :
implementation platform('com.google.firebase:firebase-bom:26.4.0')
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.firebase:firebase-analytics:17.3.0'
implementation 'com.google.firebase:firebase-installations:17.0.1'
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.8"
implementation "com.google.firebase:firebase-messaging:20.1.0"
After having tried all above suggestions, the only way I could fix this was to create a new Firebase project.
The problem started for me after creating a new Angular Ionic project as a way to upgrade to Angular 14, Capacitor 4 and Ionic 6.
Copying the same google-service.json to the new project (along with all src code files) and adjusting the package/applicationId in build.gradle and AndroidManifest.xml - created this issue.
Anyways, as said, a 3 minutes new Firebase project process resolved everything eventually.
You should use the following code to obtain SHA 1 and SHA 256 and go to the Firebase panel and add new SHAs there and also download and replace the Firebase Jason file again and clean and rebuild the project. Do it and this way your problem will be solved.
The code to get SHA is below.
keytool -list -v -keystore "I:\AndroidProject\Busnet\example.jks" -alias example -storepass example -keypass example
Add the fingerprints from the play store.
Replace the google-services.json.
It worked for me.
I started getting this all of a sudden when running integration tests on a local emulator. Turns out it had something to do with the hotel wifi I was on. I tethered to my phone and it started working again.
sometimes it's too simple to be realized.
in my case, that happened because of missing INTERNET CONNECTION

I am getting this error of Firebase auth but error is not going to solve in any way

I modified Q-municate powered by QuickBlox (which is open source) GitHub code and I put my own credentials to Firebase authentication but I am getting this error. I put all credentials, but still, I do not know what the error is.
I put all these credentials but it's still giving an error and also mentioned in the image about the error.
Project ID:
APP ID:
Package name:
These things I put in the project. Can anybody tell what the error mentioned in image is?
In current version of Q-municate (2.5) you need just add new parameter devFirebaseAuthProjectId=\"xxxxxxxxxxxxxxx\" to file q-municate-android/Q-municate_app/gradle.properties. Value for this parameter you can get in Firebase Developer Console, see screenshot: Additionally check SHA1 for your debug key in Firebase Developer Console.

Android Firebase DynamiteModule: Failed to load module descriptor

Since upgrading to the newest version of Firebase (9.0.0), I can't get rid of the following two errors when authenticating a user through signInWithEmailAndPassword(). Does anyone have an idea what's going on?
05-19 18:09:49.245 23550-23589/[PACKAGE] E/DynamiteModule: Failed to load
module descriptor class: Didn't find class
"com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor"
on path: DexPathList[[zip file
"/data/app/[PACKAGE]-3/base.apk"],nativeLibraryDirectories=
[/data/app/[PACKAGE]-3/lib/x86, /vendor/lib, /system/lib]]
And
05-19 18:09:49.252 23550-23550/[PACKAGE] E/FirebaseApp: Firebase API
initialization failure.java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.zzbu(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
(...)
Caused by: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.firebase.iid.zzg' appears in /data/data/[PACKAGE]/files/instant-run/dex/slice-com.google.firebase-firebase-iid-9.0.0_95503dc60ed409569d1585da411de93e6c633bf7-classes.dex)
at com.google.firebase.iid.zzg.zzeC(Unknown Source)
at com.google.firebase.iid.zzg.<init>(Unknown Source)
at com.google.firebase.iid.zzg.<init>(Unknown Source)
at com.google.firebase.iid.zzd.zzb(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method) 
at com.google.firebase.FirebaseApp.zza(Unknown Source) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
at com.google.firebase.FirebaseApp.zzbu(Unknown Source) 
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1748) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1723) 
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 
(...)
I had the same problem and I found a mistake done by me in my Firebase console.
One of the reason for this problem could be, your Sign In Method inside Firebase > Auth Dashboard might be disabled.
I just enabled it and it started working.
Can you check your Google Play Services version?
From Firebase oficial website:
Prerequisites
An Android device running Google Play services 9.0.0 or later
The Google Play services SDK from the Android SDK Manager
Android Studio 1.5 or higher
An Android Studio project and its package name.
Very sad that Firebase initialization errors are so not straightforward, so developers need to guess what went wrong. In my case I imported only:
compile 'com.google.firebase:firebase-auth:10.2.0'
and forgot to import also core:
compile 'com.google.firebase:firebase-core:10.2.0'
Maybe it will help someone, good luck!
I found the issue. The issue was the first prerequisite Guilherme mentioned, but not the boldfaced part.. Although your dependencies also need to explicitly state 9.+ of the play services part, the devices itself also needs to have 9.+ installed. Debugging on my phone works fine and updating the image of my emulator solves the issue there as well.
Disabling Instant Run worked for me. Sounds ridiculous, I know. I tried cleaning the project. I tried uninstalling/reinstalling the app. The thing that finally did the trick was disabling Instant Run. sigh
I logged out and then logged in and it solved this problem for me.
Probably from some kind of synchronization the FB stuff have not implemented.
If this problem consist I will try to intercept it. But reallly, this is a bug in Firebase system. And It is a bug that is caused by more than one use case, which is another issue on its own.
You can check out while adding google sign in option
Before we use
GoogleSignInOptions gso = new GoogleSignInOptions
.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
add one line as show in the following code
GoogleSignInOptions gso = new GoogleSignInOptions
.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build();
after adding this if you get the error like
An internal error has occured. [ Invalid Idp Response: id_token audience mismatch. ]
then Click here to get solution this works for me.
If you just want to use the Firebase authentication and you got here because of the error:
Didn't find class
"com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor"
Go to https://console.firebase.google.com/project/[your project]/authentication/providers and enable the authentication providers you support.
I had similar issue with signup the user but finally found a working solution.
Uninstall the HAXM and reinstall it solves my issue and it successfully signup's the user to firebase auth :)
This answer on another question made my app authenticate
Alfonso Gomez Jordana Manas
Hello Pierre,
You have to manually whitelist your existing Google OAuth 2.0 client IDs in the Firebase console before using it with the new Auth APIs.
In order to do so, follow these steps:
Go to the Credentials section in the Google API Console.
Select from the top right corner the project where you had previously configured Google Sign-In.
Go to the OAuth 2.0 client IDs section
If you are using Google Sign-In on Android or iOS applications:
Take note of the Client ID string corresponding to all the entries registered for your applications.
Input these Client IDs into your Firebase project’s configuration:
Go to the Firebase console at https://console.firebase.google.com
Open the Auth section
Under Sign-In methods, open the Google configuration, and add all your client IDs to the whitelist of client IDs from external projects.
If you are using Google Sign-In on a web application:
Click to open your web client ID and take note of both the client ID and secret.
Input this Client ID into your Firebase project’s configuration:
Go to the Firebase console at https://console.firebase.google.com
Open the Auth section
Under Sign-In methods, open the Google configuration, and add the values under the Web SDK configuration section.
Let me know if this resolves your issue.
if you do everything but you got nothing try to update your ARM EABI.
Google APIs ARM EABI v7a System Image
If your emulator has not new goggle updates you will get always auth error.
Do everything suggested in this post then update ARM EABI image.
This solved my problem.
It may also happen when you don't have the SHA1 fingerprints registered in Firebase and in Google API. There in both of them must register two fingerprints: from the debug keystore and from the production keystore (generated when you create the project's apk for the first time when you enter some password keys on Android Studio).
Here shows how to get the SHA1 from there.
or run this command on C:\Users\<user name>\.android directory.
keytool -list -v -keystore debug.keystore
Sharing my experience:
I faced the same issue, I googled everywhere but couldn't find the exact answer, even if I was doing everything as documented by Google Android documentation. Suddenly after a day, my app was working fine and at that same moment I got the email from google stating "Google APIs Explorer connected to your Google Account". And it looks to me that google takes time to grant us access, just wait for this email, maybe this issue is not related to bad code.

GooglePlayServicesUtil Internal error occurred

Trying using Google Drive Android API as described. But some strange error occurred: GooglePlayServicesUtil(3662): Internal error occurred. Please see logs for detailed information.
Previously I had create Client ID for Android application in Google Console with SHA1 of my Eclipse (Prefs → Android → Build) and my package name com.example.googlecloudbuffer.
May be shoild I use somehow a genereted CLIENT ID or something else?
The problem was in Google API Console. You must add a Email and Product name as described.

Categories

Resources