Open reenasavaliya21 opened 8 months ago
changes this things
minSdkVersion 16 targetSdkVersion 28 multiDexEnabled true
WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp();
![Uploading jd1D7.png…]() Important: The first proposal here might not be the best solution. Please read the update from 08.2022 below.
In short: 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 - api_key - current_key (as shown on the picture below).
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.
I integrate Firebase setup using Firebase CLI and I get below error into my Android Device, don't know what is issue because I get the reference from official document Flutter fire. Below is the Error that I get while run the Android App.
E/flutter ( 6487): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: [firebase_messaging/unknown] java.io.IOException: FIS_AUTH_ERROR E/flutter ( 6487): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7) E/flutter ( 6487): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18) E/flutter ( 6487):
E/flutter ( 6487): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:522:43)
E/flutter ( 6487):
E/flutter ( 6487): #3 MethodChannelFirebaseMessaging.getToken (package:firebase_messaging_platform_interface/src/method_channel/method_channel_messaging.dart:248:11)
E/flutter ( 6487):
E/flutter ( 6487): #4 NotificationService.gettoken (package:legalremit/apiservice/notification_Service.dart:273:15)
E/flutter ( 6487):
E/flutter ( 6487): #5 main.. (package:legalremit/main.dart:118:43)
E/flutter ( 6487):
E/flutter ( 6487):