Flutter firebase messaging issue on upgrade - flutter

I was using firebase_messaging 7.0.0 all is working fine but i need to update my flutter so i have upgrade firebase_messaging to 10.0.9 now its stop working on getToken.
When app load it keep crashing and showing
E/flutter (17162): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: [firebase_messaging/unknown] java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: FIS_AUTH_ERROR
I have try everything
flutter clean
implementation 'com.google.firebase:firebase-messaging:20.1.0'
But it's not working if I comment my getToken then my app is fine. I didn't find any solution on GitHub or StackOverflow. I have checked my google-service.json etc all is fine

Yes now it's different.
please follow steps here:
firebase messaging doc
and you have to add firebase_core package to your dependencies
and follow this steps too: firebase_core doc

Related

Firebase deployed flutter web page throws exception (since today) - why?

I have a flutter web app with the following dependencies, updated today to most recent ones. There was no code change! Just version updates:
firebase_storage: ^11.0.12
firebase_core: ^2.6.0
cloud_firestore: ^4.4.1
firebase_auth: ^4.2.7
Running the web app locally works fine (Chrome), but when I upload/deploy it to firebase, I get the following Exception:
VM155:2 Uncaught (in promise) TypeError: Failed to resolve module specifier 'Instance of 'TrustedScriptURL''
at window.ff_trigger_firebase_core (<anonymous>:2:18)
at mJ.v7 (main.dart.js:49235:19)
at main.dart.js:52258:9
at aJx.a (main.dart.js:6218:62)
at aJx.$2 (main.dart.js:45146:14)
at Object.M (main.dart.js:6204:10)
at ag6.aqG (main.dart.js:52262:10)
at ag6.BK (main.dart.js:52239:21)
at ag8.$1 (main.dart.js:52332:15)
at e9.q (main.dart.js:44287:19)
which is this statement
and the same exceptions for all other firebase packages:
The problem is, when I now revert back to the old firebase version, the problem stays! I donĀ“t know what happened. Edge browser shows the same exception.
Thanks!

Error when trying to initialize Firebase on flutter project

I'm receiving this error when try to initialize firebase on my flutter project
MissingPluginException (MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core))
Someone have a clue about what I can do ?
App Gradle
Gradle plugins
Project Gradle
Flutter dependencies
I have setuped the firebase as the Google documentation
await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform);
Already tried on another simulator, already tried to create a fully new simulator, already tried on different devices, already tried with a specific's version of firebase, already tried to add
minifyEnabled false
shrinkResources false
to the gradle, but nothing works, already saw every video on the youtube about it,
The application throw this error for both platforms, android and iOS

Calling Firebase.initializeApp() returns 'Unable to establish connection on channel' - Flutter + Firebase

I'm working with Firebase in flutter (latest versions as of 1st July 2022), and when I try to call Firebase.initializeApp() in my Main function, it returns an error of:
'[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)'
Here is my code:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
Firebase.initializeApp();
runApp(const MyApp());
}
Any help would be greatly appreciated
I was able to solve the problem by upgrading all my firebase dependencies to the latest version using flutter pub outdated and flutter pub upgrade firebase_....
I encountered this issue after adding the firebase_messaging plugin v11.4.4. Might be related to the change in firebase_core_platform_interface.
Also got it after a pub update. Fixed it by doing:
flutter clean
and removing the pubspec.lock
Do a flutter clean and upgrade firebase core with
flutter pub upgrade firebase_core
The run
dart pub global activate flutterfire_cli
flutterfire configure
to reinitialize firebase. I experienced this after adding app_check support
I have updated the below dependency:
dependency_overrides:
firebase_core_platform_interface: 4.4.1
Executed this command and updated firebase dependencies
flutter pub upgrade firebase_core
flutter pub upgrade firebase_messaging
it is working properly now.
Problem seems to be with the core platform interface.
Add firebase_core_platform_interface: 4.4.0 and adjust all other firebase deps to make them compatible with this library. I downgraded all versions to 36 day old release and it finally works.
I just built a new flutter app and I got this error when initializing Firebase App and running it in the browser and not the android emulator. I am using VS Code and you can change the target device in the bottom task bar on the right side.
Solution is to run it in the android emulator. I don't know if there are permissions to be set for web view but I do not plan on deploying to web.
Had the same problem and scaled back (thank you git) - getting flutter dependencies right - as in it compiles and work as advertised is no mean feat. Welcome :)

flutter has a problem with redux dependencies

i have a problem to run my flutter app, it seems flutter doesn't recognize it. i tried to connect to internet while running the project but the problem remains the same, here is the error message:
and here is the code where i inserted the dependency :
dependencies:
redux: ^4.0.0
flutter_redux: ^0.6.0
Your package name is likely also redux according to this Github issue. You'll have to change your package name to something other than redux and you should be able to flutter pub get.
this error was caused by the fact that i named my app REDUX, i changed it and it works now.

How to use cloud_firestore in flutter for web and android?

I have a Flutter app which works on Android as expected but if I want to compile it for Web I get an error.
It has to do something with the dependency cloud_firestore. If I use the dependency firebase it works fine on the web but on android now not..
This is the error message I get using cloud_firestore (compiling for web):
Skipping compiling pay_balance|lib/main_web_entrypoint.dart with ddc because some of its
transitive libraries have sdk dependencies that not supported on this platform:
firebase_core|lib/firebase_core.dart
https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings
Can anybody help me? Maybe with another dependency for firestore (I did not find others which are working on web and android)..
Edit: I have used the firebase-dart plugin for web!! -> Only works on the web but not in android for me -> I need something for both at the same time!!
Or is there a Way I can use both packages without getting a compling error for the web when I import cloud_firestore?
If you want to use Firebase on Web and Mobile you have to get creative. I created the fb_auth plugin that uses the Mobile SDK firebase_auth on iOS and Android and the firebase package on web. This will give you a single plugin for auth.
https://pub.dev/packages/fb_auth
Im working on firstore and storage but they are not ready yet.
I have also created an article on how to do this with flutter:
https://medium.com/#rody.davis.jr/how-to-build-a-native-cross-platform-project-with-flutter-372b9e4b504f
You have to use dynamic imports so that at compile time it tree shakes what it doesn't need and will not throw an error.
Currently this is the only way to officially use both plugins in the same project.
EDIT: cloud_firestore now added
Two of the FutterFire plugins are now supported for web. FlutterFire plugins supporting web firebase_auth and firebase_core
cloud_firestore is now also supported