Chris
Chris

Reputation: 2294

Flutter Web fails with firebase "Too many positional arguments: 1 allowed, but 2 found"

Since today I can not run my Flutter Web project anymore because it fails with:

: Error: Too many positional arguments: 1 allowed, but 2 found. firebase_auth_web.dart:94 Try removing the extra positional arguments. FirebaseCoreWeb.registerService('auth', (firebaseApp) async { ^ : Context: Found this candidate, but the arguments don't match. firebase_core_web.dart:43 static void registerService( ^^^^^^^^^^^^^^^

I've already updated the Core and Auth to the latest versions:

firebase_core: ^2.14.0

firebase_auth: ^4.2.10

And I am running Flutter 3.10.0.

Anyone else experiencing this issue? I didn't change anything, at least not on purpose.

Upvotes: 7

Views: 1501

Answers (2)

luisv
luisv

Reputation: 156

Had the same problem since June 10th, however it was not critical for me to solve. Just saw your post and tried it again. Solved it by running:

flutter clean
flutter pub get
flutter pub upgrade firebase_core_web
flutter pub upgrade firebase_auth_web
flutter pub upgrade

Maybe the packages have been updated and the version interference is not there anymore. Hope this helps.

Upvotes: 9

spydon
spydon

Reputation: 11572

Try to do a flutter clean and then a flutter pub get again, it seems like somehow you're getting an old version of firebase_auth.

Because in the newest version (which is the one that you've listed), the call to registerService doesn't look like that, it looks like this, i.e. one positional parameter and one named.

You can also see that is how the call should be looking like in firebase_core.

Also make sure that you don't have any dependency overrides.

Upvotes: 1

Related Questions