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

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!

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!

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 firebase messaging issue on upgrade

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

How to solve 'could not find package integration_test in the Flutter SDK' error

I have an app, it is very simple and I keep getting this error:
pub get failed (server unavailable) -- attempting retry 1 in 1
second... Because bascis depends on integration_test any from sdk
which doesn't exist (could not find package integration_test in the
Flutter SDK), version solving failed.
I have tried
Pup upgrade, Pub get.
How can I get rid of this error?
I had the same error after changing my channel from master to stable. I was able to fix it by removing (or commenting out) the following library from pubspec.yaml
dev_dependencies:
# integration_test:
# sdk: flutter
I experienced this when I was trying to setup a flutter web project without enabling flutter web on my PC. I enabled flutter for web and everything was okay.
For me had to comment out sdk part like so:
dev_dependencies:
integration_test:
# sdk: flutter
It is likely due to your network problem. Because the output says (server unavailable).
Ways to debug this:
Try curl https://google.com to see whether your command line can connect to network.
Also try, for example, curl https://flutter.dev (or, try to curl the actual url your pub get is trying to access.
This may due to, for example, your network is broken. Or because you have a broken VPN, broken proxy, etc.

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.