E/FirebaseInstanceId( 8475): Failed to get FIS auth token - flutter

E/FirebaseInstanceId( 8475): Failed to get FIS auth token
E/FirebaseInstanceId( 8475): java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later.
I am facing this problem. Because of this firebase messaging is not working. I am facing this error on the my live app also.
I tried to:
flutter clean
Build project again
redownloaded the google-services.json file
Tried to change the firebase dependencies.
"But it didn't work".

Related

Firebase authentication error: "class file contains wrong class: io.flutter.plugins.firebase.core.FlutterFirebasePlugin"

I'm using Flutter and Firestore on my application. I decided to use the Firebase authentication library and I have just typed flutter pub add firebase_auth on my terminal.
After running the app through flutter run, I'm having a "bad class file" error for the following route:
build\firebase_auth\intermediates\compile_library_classes_jar\debug\classes.jar(/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.class)
The error says:
class file contains wrong class: io.flutter.plugins.firebase.core.FlutterFirebasePlugin
Please remove or make sure it appears in the correct subdirectory of the classpath.
1 error
FAILURE: Build failed with an exception.
I emptied the pub cache, then I removed the firebase authentication package and run the app then it worked again like a charm.
Then I added firebase_auth: ^4.2.8 into my dependencies and typed flutter pub get, then ran the app again and I received the same error!

Flutter Web and multiple deployment error

I am trying to set up a production/development of a Flutter web app for Firebase. I am able to deploy to the first one I configured (production) but not to the second (development). I am getting this error:
=== Deploying to 'my-app-dev'...
i deploying hosting i hosting[my-app-dev]: beginning deploy... i
hosting[my-app-dev]: found 27 files in build/web ⠋ hosting: uploading
new files [3/21] (14%) Error: Task
1c5e4be41a8a2901d8c9ae4edb5c2bd26c5c4d0564d732a3ce2bef7c6c27bcb0
failed: retries exhausted after 6 attempts, with error: The "path"
argument must be of type string. Received undefined ⠸ hosting:
uploading new files [4/21] (19%)
I am running the following commands:
firebase use my-app-dev
flutterfire configure --project=my-app-dev
flutter build web
firebase deploy
Note: if I use my-app-prod instead it works perfectly.
What am I doing wrong?
I faced the same problem and I solved it with the next two steps:
remove the .firebase folder from the root folder of your project
try to deploy your project again with firebase deploy

Flutter Firestore throwing Google Playstore exception on emulator

I am using Firebase auth and Firebase Firestore. My auth implementation i working fine. As soon as I hooked the Firebase Firestore, I keep getting a FATAL error that Google Playstore service is needed. I am running on Pixel_3a_API_30_x86 emulator. Firestore does not require Google Play service as per the google documentation. I am not sure why is this happening. I have googled but nothing have I found. On a different emulator, it is working fine. I am using a Mac. Here is the error reported in IDE. Thanks in advance for any advise.
/GooglePlayServicesUtil( 3512): Google Play Store is missing.
E/GooglePlayServicesUtil( 3512): GooglePlayServices not available due to error 9
W/Firestore( 3512): (23.0.4) [GrpcCallProvider]: Failed to update ssl context: com.google.android.gms.common.GooglePlayServicesNotAvailableException
I/TetheringManager( 3512): registerTetheringEventCallback:com.theshuk.rental
W/.theshuk.renta( 3512): Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (greylist-max-q,core-platform-api, reflection, denied)
W/.theshuk.renta( 3512): Accessing hidden method Lcom/android/org/conscrypt/AbstractConscryptSocket;->getAlpnSelectedProtocol()[B (greylist-max-q, reflection, denied)
E/AndroidRuntime( 3512): FATAL EXCEPTION: grpc-okhttp-0
After further investigation it turns out the exception is pertaining to grpc-okhttp-0. Even though GooglePlayServicesUtil is reported as E ( Errors ) it still continues.
The grpc-okhttp-0 exception happens only on some emulators, not all. For example pixel 4a works fine. To solve the problem, I added the following to my build.gradle file.
implementation "io.grpc:grpc-okhttp:1.41.0"
It worked.

Firebase Crashlytics 'Error loading your issues' and upload-symbols script error - iOS App using XCode

I recently noticed all of my crash reports in Firebase Crashlytics were not being deobfuscated, they were all returning compiler errors and memory locations (eg <compiler-generated> - Line 4331771636, EXC_BREAKPOINT 0x0000000102afd6f4), rather than function names and line numbers. I realised it's because Fabric has been shutdown (4th May 2020), so I began the transition to Firebase Crashlytics.
I changed my pod file and added the Firebase/Crashlytics pod, and followed the transition instructions located here.
I've put the following code in my Run script under Build Phases in Xcode:
"${PODS_ROOT}/FirebaseCrashlytics/run"
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
When I build my project I get the following error returned from upload-symbols:
Fetching upload-symbols settings...
[31merror: Could not fetch upload-symbols settings: Could not connect to the server.[0m
Command PhaseScriptExecution failed with a nonzero exit code
If I manually run the upload-symbols script in terminal, I get the same error error: Could not fetch upload-symbols settings: Could not connect to the server.
I also noticed that on the Crashlytics dashboard in Firebase, I had lost all my previous crash data and was receiving the message Error loading your issues.
How can I fix the errors and get Crashlytics working like before?
The solution was to force a crash in my app using fatalError(). It is not obvious that this is required to finalise the registration of the new SDK with the Firebase Crashlytics backend.
After doing this, all my historical crash data is available like before, and upload-symbols completes successfully.

Flutter build error. Issue with flutter webview plugin

I have added the flutter webview plugin but its causing problems. Its giving some error when building the project. I tried to delete the cache and rebuild the project but it didn't work.
I just started learning flutter and can't find a solution to this problem.
Below is the error I am getting.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':flutter_webview_plugin:compileDebugJavaWithJavac'.
Unable to find source java class: 'C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.0.9+1\android\src\main\java\com\flutter_webview_plugin\WebviewActivity.java' because it does not belong to any of the source dirs: '[C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.1.5\android\src\main\java, C:\Users\personal\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.1.5\android\src\debug\java, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\r\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\buildConfig\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\aidl\debug, C:\Users\personal\Documents\AndroidStudioProjects\flutter_newz\build\flutter_webview_plugin\generated\source\rs\debug]'
BUILD FAILED in 54s
Finished with error: Gradle build failed: 1
I was using other plugins for firebase auth, firebase analytics, google sign in , webview, ect. Updating all the plugins to the latest version solved the problem.