E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED - what changed?

e/firebaseinstanceid: token retrieval failed: service_not_available
firebaseinstanceid: binding to the service failed
getinstanceid failed java io ioexception authentication_failed
firebaseinstanceid background sync failed: service_not_available
java.io.ioexception: service_not_available
network error (such as timeout firebase android)
firebase console tutorial
firebaseinstanceid getinstance getinstanceid

I'm not sure what's going on here, I pulled my recently updated repo and every time I open the app to debug it on an emulator I get E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED as the app loads up the main screen. However this hadn't happened before today so I don't know what could've changed? I deleted the app from the Firebase console and re-added it (through Firebase Assistant), but that didn't fix it either? I've included my build.grade file but I'm not sure what else I need to be looking at, any assistance would be appreciated.

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.android.projectrc"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.wdullaer:materialdatetimepicker:3.4.0'
    implementation "org.jetbrains.anko:anko:$anko_version"
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.github.bumptech.glide:glide:4.2.0'
    implementation 'com.google.firebase:firebase-auth:11.0.4'
    implementation 'com.google.firebase:firebase-database:11.0.4'
    implementation 'com.google.firebase:firebase-storage:11.0.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}








apply plugin: 'com.google.gms.google-services'

The problem in my case was that the emulator was not connected to internet, seems that is not implicitly connected like the ios simulator.

E/FirebaseInstanceId: Token retrieval failed , I am using Android Studio 3.2.1 for Mac. E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED. I can ping the fire database  E/FirebaseInstanceId( 6227): Token retrieval failed: AUTHENTICATION_FAILED D/EGL_emulation( 6227): eglMakeCurrent: 0xe9185c60: ver 3 0 (tinfo 0xd33e6050) I then tried to use API 24 and the AUTHENTICATION_FAILED is gone but my google play service is outdated.

Using an emulator WITHOUT Google Play will cause this error.

Firebase Token retrieval failed: AUTHENTICATION_FAILED · Issue , E/FirebaseInstanceId( 6227): Token retrieval failed: AUTHENTICATION_FAILED To hot reload changes while running, press "r". I then tried to use API 24 and the AUTHENTICATION_FAILED is gone but my google play  E/FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE Edit: I tried the solutions existing on internet but none of them is working. android firebase firebase-realtime-database

Check if you have internet connection in your emulator. I had the same issue and running emulator like this helped me:

emulator -avd <Avd name> -dns-server 8.8.8.8

E/FirebaseInstanceId: Token retrieval failed - html, E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED Firebase I immediately get this error: Failed to resolve: firebase-messaging-​15.0.0 Open classpath 'com.google.gms:google-services:4.0.1' // I changed this to latest  Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more FirebaseInstanceId Token retrieval failed SERVICE_NOT_AVAILABLE

My guess is that a new version of the Google Play library has been released and your test device/emulator need update his currently installed version.

Check the Google Play Store app on your device/emulator, make the update, and you should be good to go !

E/FirebaseInstanceId: Token retrieval failed, E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED - what changed? I'm not sure what's going on here, I pulled my recently  Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

I faced the same same problem. I was using a Nexus with API 28 and it was buggy and I couldn't update the Google Play.

I had to create another simulator with the API 24 and update the Google Play from the simulator. Now, the email auth and firestore works, but the Facebook and Google login doesn't work despite it works on ios.

Flutter with Firebase Authentication: Google (on android) – Andy , E/FirebaseInstanceId("6066"): Token retrieval failed: AUTHENTICATION_FAILED​. The 6066 is Unless you've changed things yourself, there will be no password on the keystore, so if primpted for it, press Enter. You need to  Because that's where I'd expect messages with FirebaseInstanceId to come from. – Frank van Puffelen Jun 22 '18 at 14:43 Rebuild your project after changing google-services.json – Fathur Rohim Apr 29 at 10:27

E/FirebaseInstanceId: Token retrieval failed , E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED. Using an emulator WITHOUT Google Play will cause this error. D/FirebaseInstanceId: background sync failed: AUTHENTICATION_FAILED Also, when i click on Log Token button in the emulator, i getnull token. Can someone please help me?

E/FirebaseInstanceId: Token retrieval failed, E/FirebaseInstanceId: Token retrieval failed: E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED - what changed? E/FirebaseInstanceId(28179): Topic sync or token retrieval failed on hard failure exceptions: AUTHENTICATION_FAILED. Won't retry the operation.

flutter/flutter, E/FirebaseInstanceId( 5639): Token retrieval failed: AUTHENTICATION_FAILED I have latest Android Studio version, latest firebase packages and emulator  Once an Instance ID is generated, the library periodically sends information about the application and the device where it's running to the Firebase backend. To stop this, see deleteInstanceId (). The identifier for the application instance. public static FirebaseInstanceId getInstance () Returns an instance of this class.

Comments
  • have you authenticated the user?
  • yes! I've been using a test account that was created months ago - what doesn't make sense is why this is happening before a user even logs in - I've noticed that sometimes the emulator's internet connection is spotty (which makes even less sense as I'm connected through LAN on my desktop) so I'm wondering if that's the issue.
  • I have the same issue with a real device and before getting the token I check if google play services are updated and they are. I am sure to have network connection too.
  • So, how do you install the Play app, or update it?
  • Open the simulator, go to settings and then Google Play and click on Update. Is not all the devices that you can update. If you having problems updating try a different API like I did going to the 24 instead of 28
  • I have the same issue with a real device and before getting the token I check if google play services are updated and they are. I am sure to have network connection too.
  • This is not a answer. This should be a comment else please do update your answer with more details