Zahid Tekbaş
Zahid Tekbaş

Reputation: 931

Failed to get FIS auth token on Flutter Android

I've encountered with a problem today. 2 or 3 days ago, I integrate FCM in my Flutter App. There were some lack of implementation but I did not care because FCM part of my coding phase did not come yet. But today, before starting to code, normally I run flutter run and these are the logs.


W/ConnectionTracker(17017): java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.measurement.internal.zzja@e8966f2
W/ConnectionTracker(17017):     at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1832)
W/ConnectionTracker(17017):     at android.app.ContextImpl.unbindService(ContextImpl.java:1880)
W/ConnectionTracker(17017):     at android.content.ContextWrapper.unbindService(ContextWrapper.java:741)
W/ConnectionTracker(17017):     at com.google.android.gms.common.stats.ConnectionTracker.zza(com.google.android.gms:play-services-basement@@17.3.0:55)
W/ConnectionTracker(17017):     at com.google.android.gms.common.stats.ConnectionTracker.unbindService(com.google.android.gms:play-services-basement@@17.3.0:50)
W/ConnectionTracker(17017):     at com.google.android.gms.measurement.internal.zzjb.zzF(com.google.android.gms:play-services-measurement-impl@@18.0.2:6)
W/ConnectionTracker(17017):     at com.google.android.gms.measurement.internal.zzil.zza(com.google.android.gms:play-services-measurement-impl@@18.0.2:5)
W/ConnectionTracker(17017):     at com.google.android.gms.measurement.internal.zzak.run(com.google.android.gms:play-services-measurement-impl@@18.0.2:5)
W/ConnectionTracker(17017):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
W/ConnectionTracker(17017):     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/ConnectionTracker(17017):     at com.google.android.gms.measurement.internal.zzfh.run(com.google.android.gms:play-services-measurement-impl@@18.0.2:6)
E/FirebaseInstanceId(17017): Failed to get FIS auth token
E/FirebaseInstanceId(17017): java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-tasks@@17.1.0:69)
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-tasks@@17.1.0:23)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.setDefaultAttributesToBundle(com.google.firebase:firebase-iid@@21.0.1:11)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.startRpc(com.google.firebase:firebase-iid@@21.0.1:1)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.getToken(com.google.firebase:firebase-iid@@21.0.1:1)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$1$FirebaseInstanceId(Unknown Source:2)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId$$Lambda$3.start(Unknown Source:8)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.RequestDeduplicator.getOrStartGetTokenRequest(com.google.firebase:firebase-iid@@21.0.1:7)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$2$FirebaseInstanceId(Unknown Source:33)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId$$Lambda$0.then(Unknown Source:6)
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.zzf.run(com.google.android.gms:play-services-tasks@@17.1.0:2)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseInstanceId(17017):    at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.3.0:6)
E/FirebaseInstanceId(17017):    at java.lang.Thread.run(Thread.java:929)
E/FirebaseInstanceId(17017): Caused by: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(FirebaseInstallationServiceClient.java:200)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(FirebaseInstallations.java:533)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:388)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:377)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseInstanceId(17017):    ... 1 more
W/FirebaseInstanceId(17017): Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval
E/FirebaseInstanceId(17017): Failed to get FIS auth token
E/FirebaseInstanceId(17017): java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-tasks@@17.1.0:69)
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-tasks@@17.1.0:23)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.setDefaultAttributesToBundle(com.google.firebase:firebase-iid@@21.0.1:11)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.startRpc(com.google.firebase:firebase-iid@@21.0.1:1)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.getToken(com.google.firebase:firebase-iid@@21.0.1:1)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$1$FirebaseInstanceId(Unknown Source:2)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId$$Lambda$3.start(Unknown Source:8)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.RequestDeduplicator.getOrStartGetTokenRequest(com.google.firebase:firebase-iid@@21.0.1:7)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$2$FirebaseInstanceId(Unknown Source:33)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId$$Lambda$0.then(Unknown Source:6)
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.zzf.run(com.google.android.gms:play-services-tasks@@17.1.0:2)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseInstanceId(17017):    at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.3.0:6)
E/FirebaseInstanceId(17017):    at java.lang.Thread.run(Thread.java:929)
E/FirebaseInstanceId(17017): Caused by: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(FirebaseInstallationServiceClient.java:200)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(FirebaseInstallations.java:533)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:388)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:377)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseInstanceId(17017):    ... 1 more
W/FirebaseInstanceId(17017): Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval
E/FirebaseInstanceId(17017): Failed to get FIS auth token
E/FirebaseInstanceId(17017): java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-tasks@@17.1.0:69)
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-tasks@@17.1.0:23)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.setDefaultAttributesToBundle(com.google.firebase:firebase-iid@@21.0.1:11)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.startRpc(com.google.firebase:firebase-iid@@21.0.1:1)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.getToken(com.google.firebase:firebase-iid@@21.0.1:1)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$1$FirebaseInstanceId(Unknown Source:2)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId$$Lambda$3.start(Unknown Source:8)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.RequestDeduplicator.getOrStartGetTokenRequest(com.google.firebase:firebase-iid@@21.0.1:7)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$2$FirebaseInstanceId(Unknown Source:33)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId$$Lambda$0.then(Unknown Source:6)
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.zzf.run(com.google.android.gms:play-services-tasks@@17.1.0:2)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseInstanceId(17017):    at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.3.0:6)
E/FirebaseInstanceId(17017):    at java.lang.Thread.run(Thread.java:929)
E/FirebaseInstanceId(17017): Caused by: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(FirebaseInstallationServiceClient.java:200)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(FirebaseInstallations.java:533)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:388)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:377)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseInstanceId(17017):    ... 1 more
W/FirebaseInstanceId(17017): Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval
W/Settings(17017): Setting device_provisioned has moved from android.provider.Settings.Secure to android.provider.Settings.Global.
V/HiTouch_HiTouchSensor(17017): User setup is finished.
W/HiTouch_PressGestureDetector(17017): Touch pointer move a lot. The moving distance of X is:5.0, limit is:60The moving distance of Y is:64.0, limit is:60
E/FirebaseInstanceId(17017): Failed to get FIS auth token
E/FirebaseInstanceId(17017): java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-tasks@@17.1.0:69)
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-tasks@@17.1.0:23)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.setDefaultAttributesToBundle(com.google.firebase:firebase-iid@@21.0.1:11)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.startRpc(com.google.firebase:firebase-iid@@21.0.1:1)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.getToken(com.google.firebase:firebase-iid@@21.0.1:1)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$1$FirebaseInstanceId(Unknown Source:2)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId$$Lambda$3.start(Unknown Source:8)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.RequestDeduplicator.getOrStartGetTokenRequest(com.google.firebase:firebase-iid@@21.0.1:7)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$2$FirebaseInstanceId(Unknown Source:33)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId$$Lambda$0.then(Unknown Source:6)
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.zzf.run(com.google.android.gms:play-services-tasks@@17.1.0:2)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseInstanceId(17017):    at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.3.0:6)
E/FirebaseInstanceId(17017):    at java.lang.Thread.run(Thread.java:929)
E/FirebaseInstanceId(17017): Caused by: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(FirebaseInstallationServiceClient.java:200)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(FirebaseInstallations.java:533)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:388)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:377)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseInstanceId(17017):    ... 1 more
W/FirebaseInstanceId(17017): Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval


E/FirebaseInstanceId(17017): Failed to get FIS auth token


E/FirebaseInstanceId(17017): java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-tasks@@17.1.0:69)
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-tasks@@17.1.0:23)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.setDefaultAttributesToBundle(com.google.firebase:firebase-iid@@21.0.1:11)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.startRpc(com.google.firebase:firebase-iid@@21.0.1:1)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.GmsRpc.getToken(com.google.firebase:firebase-iid@@21.0.1:1)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$1$FirebaseInstanceId(Unknown Source:2)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId$$Lambda$3.start(Unknown Source:8)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.RequestDeduplicator.getOrStartGetTokenRequest(com.google.firebase:firebase-iid@@21.0.1:7)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$2$FirebaseInstanceId(Unknown Source:33)
E/FirebaseInstanceId(17017):    at com.google.firebase.iid.FirebaseInstanceId$$Lambda$0.then(Unknown Source:6)
E/FirebaseInstanceId(17017):    at com.google.android.gms.tasks.zzf.run(com.google.android.gms:play-services-tasks@@17.1.0:2)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseInstanceId(17017):    at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.3.0:6)
E/FirebaseInstanceId(17017):    at java.lang.Thread.run(Thread.java:929)
E/FirebaseInstanceId(17017): Caused by: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(FirebaseInstallationServiceClient.java:200)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(FirebaseInstallations.java:533)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:388)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:377)
E/FirebaseInstanceId(17017):    at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
E/FirebaseInstanceId(17017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FirebaseInstanceId(17017):    ... 1 more
W/FirebaseInstanceId(17017): Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval

This is my app level gradle dependencies:


apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

dependencies {
   implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
   implementation 'com.android.support:multidex:1.0.3'
   implementation platform('com.google.firebase:firebase-bom:26.5.0')
   implementation 'com.google.firebase:firebase-analytics:18.0.2'
   implementation 'com.google.firebase:firebase-messaging:21.0.1'
   implementation 'com.google.firebase:firebase-firestore:22.1.0'
   implementation 'com.google.firebase:firebase-auth:20.0.2'
   implementation 'com.google.android.gms:play-services-basement:17.5.0'
}

This is the Application.java file placed in android/app/src/main/java/io/flutter/plugins/


package com.xyz.yzx;

import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin;


public class Application extends FlutterApplication implements PluginRegistrantCallback {
 @Override
 public void onCreate() {
   super.onCreate();
   FlutterFirebaseMessagingService.setPluginRegistrant(this);
 }

 @Override
 public void registerWith(PluginRegistry registry) {
   FirebaseMessagingPlugin.registerWith(registry.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));

 }
}

This is the MainActivity.kt placed in android/app/src/main/kotlin/com/xyz/zxy

package com.xyz.zxy

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}

Also I converted android:name to .Application because I want to implement FCM right?

   <application
       android:name=".Application"

I did those:

After being unsuccessful, I chose a different path.

I cross check google-services.json file in android/app/src with the newest google-services.json file I have just downloaded from Firebase. Everything is same. Still I replaced the old one with the fresh file.

No solution found.

I have checked build/app/generated/res/google-services folder and cross check values.xml with Firebase information. Still same files and API datas. Such as google_api_key, google_app_id, google_storage_bucket, gcm_defaultSenderId etc. are completely match each other.

Future<void> main() async {
  Paint.enableDithering = true;
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  await setupHive();
  runApp(MyApp());
}

This is the main block of my project. I did not call FCM in there and did not call it from anywhere of my app except Application.java file in android files.

firebase dependencies in pubspec.yaml to indicate the versions of them:

  firebase_admob: ^0.11.0+1
  firebase_messaging:
  firebase_core: ^0.7.0
  firebase_auth: ^0.20.0+1
  cloud_firestore: ^0.16.0

The app is in production mode which removes all restrictions in Firebase and Google Cloud Platform. I check Google Cloud Platform and made sure there is no restriction. Also Firebase Installations are enabled.

Due to Failed to get FIS auth token on Flutter Android and W/FirebaseInstanceId(17017): Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval I can not use Authentication service, I can not use Firestore service etc. So the application is somehow dead even in production stage.

I don't know how to solve this problem. Can anyone help me?

EDIT:

When I try to sign-up with e-mail and password method this is the output in log:

I/FirebaseAuth(17017): [FirebaseAuth:] Preparing to create service connection to fallback implementation

W/System  (17017): Ignoring header X-Firebase-Locale because its value was null.

Upvotes: 1

Views: 8321

Answers (1)

Zahid Tekbaş
Zahid Tekbaş

Reputation: 931

I found the solution and I'm embarrassed with the solution. It is only a bad connection problem. I thought having an internet is enough to make connection with Firebase but it is not.

I connect to my own personal hotspot and everything works fine. I'm going to check with other connections in my area.

Upvotes: 7

Related Questions