firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.68k stars 3.97k forks source link

[web]: Dependency issue with other package using `web: ^1.0.0` #13190

Closed vikastechextensor closed 1 month ago

vikastechextensor commented 2 months ago

Is there an existing issue for this?

Which plugins are affected?

Core, Messaging

Which platforms are affected?

Android, iOS

Description

its now giving version compatibility issues with others

Reproducing the issue

Resolving dependencies... Because no versions of firebase_messaging match >15.0.4 <16.0.0 and firebase_messaging 15.0.4 depends on firebase_messaging_web ^3.8.12, firebase_messaging ^15.0.4 requires firebase_messaging_web ^3.8.12. Because firebase_messaging_web 3.8.12 depends on web ^0.5.1 and no versions of firebase_messaging_web match >3.8.12 <4.0.0, firebase_messaging_web ^3.8.12 requires web ^0.5.1. Thus, firebase_messaging ^15.0.4 requires web ^0.5.1. And because share_plus >=10.0.1 depends on web ^1.0.0, firebase_messaging ^15.0.4 is incompatible with share_plus >=10.0.1. So, because sportdunia depends on both firebase_messaging ^15.0.4 and share_plus ^10.0.2, version solving failed. Process finished with exit code 1

Firebase Core version

3.3.0

Flutter Version

3.24.0

Relevant Log Output

Resolving dependencies...
Because no versions of firebase_messaging match >15.0.4 <16.0.0 and firebase_messaging 15.0.4 depends on firebase_messaging_web ^3.8.12, firebase_messaging ^15.0.4 requires firebase_messaging_web ^3.8.12.
Because firebase_messaging_web 3.8.12 depends on web ^0.5.1 and no versions of firebase_messaging_web match >3.8.12 <4.0.0, firebase_messaging_web ^3.8.12 requires web ^0.5.1.
Thus, firebase_messaging ^15.0.4 requires web ^0.5.1.
And because share_plus >=10.0.1 depends on web ^1.0.0, firebase_messaging ^15.0.4 is incompatible with share_plus >=10.0.1.
So, because sportdunia depends on both firebase_messaging ^15.0.4 and share_plus ^10.0.2, version solving failed.
Process finished with exit code 1

Flutter dependencies

Expand Flutter dependencies snippet
```yaml Replace this line with the contents of your `flutter pub deps -- --style=compact`. ```
Resolving dependencies... Because no versions of firebase_messaging match >15.0.4 <16.0.0 and firebase_messaging 15.0.4 depends on firebase_messaging_web ^3.8.12, firebase_messaging ^15.0.4 requires firebase_messaging_web ^3.8.12. Because firebase_messaging_web 3.8.12 depends on web ^0.5.1 and no versions of firebase_messaging_web match >3.8.12 <4.0.0, firebase_messaging_web ^3.8.12 requires web ^0.5.1. Thus, firebase_messaging ^15.0.4 requires web ^0.5.1. And because share_plus >=10.0.1 depends on web ^1.0.0, firebase_messaging ^15.0.4 is incompatible with share_plus >=10.0.1. So, because sportdunia depends on both firebase_messaging ^15.0.4 and share_plus ^10.0.2, version solving failed. Process finished with exit code 1 ### Additional context and comments _No response_
TabFunk commented 2 months ago

firebase_analytics: ^11.2.1 firebase_messaging: ^15.0.4 firebase_crashlytics: ^4.0.4 firebase_in_app_messaging: ^0.8.0+4

Because every version of lib_utils from git depends on file_picker ^8.1.2 which depends on web ^1.0.0, And because firebase_messaging >=15.0.4 depends on firebase_messaging_web ^3.8.12 which depends on web ^0.5.1, lib_utils from git is incompatible with firebase_messaging >=15.0.4. So, because ask_teacher depends on both firebase_messaging >=15.0.4 and lib_utils from git, version solving failed.

Flutter Version Flutter 3.24.0 • channel stable • https://github.com/flutter/flutter.git Framework • revision 80c2e84975 (2 weeks ago) • 2024-07-30 23:06:49 +0700 Engine • revision b8800d88be Tools • Dart 3.5.0 • DevTools 2.37.2

How to solve it

lore-co commented 2 months ago

Agreed, it is giving issues with geolocator and share_plus for me

BenjiFarquhar commented 2 months ago

Same, with auto_route

Lyokone commented 2 months ago

As you can see in https://pub.dev/packages/web/changelog (and it was explained in already 2 issues)

Require Dart ^3.4.0.

We are not going to drop support for Dart < 3.4.0 right away. If you have an issue with this, you can use

dependency_overrides:
  web: ^1.0.0
Lyokone commented 2 months ago

Also, please search for duplicates before posting new issues: https://github.com/firebase/flutterfire/issues/13112

BenjiFarquhar commented 2 months ago

@Lyokone

As you can see in https://pub.dev/packages/web/changelog (and it was explained in already 2 issues)

Require Dart ^3.4.0.

We are not going to drop support for Dart < 3.4.0 right away. If you have an issue with this, you can use

dependency_overrides:
  web: ^1.0.0

The stable version of flutter is already supporting dart 3.5.0. The solution suggested will break code. It certainly didn't compile for me. web 1.0.0 is a big breaking change, which is why people need it. Are you saying that all of the other packages that support web 1.0.0 are wrong? The optimal solution is to release a new version with web ^1.0.0. People can remain on the old version of this package and it will suit people who are on old versions of flutter/dart. People using the latest versions of this package can then use the latest versions of the other packages.

Lyokone commented 2 months ago

I'm not saying other packages are wrong, I'm saying that given its size, FlutterFire needs to be aware, and support people who cannot always update to the latest version of Flutter right away. Dart 3.4.0 was released May 14, 2024, less than 4 months ago. I'll ready a PR with web 1.0.0 if you need to update right away, but it will not be merged directly.

dkbast commented 2 months ago

@Lyokone would it be possible to have this as a "prerelease" on pub? Are there reasons against this?

darkstarx commented 1 month ago

As you can see in https://pub.dev/packages/web/changelog (and it was explained in already 2 issues)

Require Dart ^3.4.0.

We are not going to drop support for Dart < 3.4.0 right away. If you have an issue with this, you can use

dependency_overrides:
  web: ^1.0.0

You have a great instrument called versioning. What's wrong with it? Those people who need old version of Flutter can use old version of Firebase, but the latest version of Firebase should support the latest version of Flutter and other latest packages of the infrastructure.

maRci002 commented 1 month ago

The popular package cached_network_image depends on web 1.0.0 to support WASM. However, since the Firebase packages don't support web 1.0.0, my app won't compile with WASM. I believe the Firebase packages should use the latest stable version of the web package.

mark8044 commented 1 month ago

Im a big fan of maintaining code for old versions as well. In this case however, pub.dev allowing for old versions to be installed solves that issue completely. Please re-consider and merge in the web1.0.0, there are some significant changes in it that I believe the majority of people will want across all their different packages

As the days go on, more and more people like me will appear here. So another benefit is that you can avoid all these people coming here and making a comment 👍

MjnMixael commented 1 month ago

Welp.. count me in as another that wound up here after finding this package being the reason I can't use web 1.0.0.

AlexFeldmeier commented 1 month ago

I am curious what breaking changes prevent this package from upgrading to 1.0.0 since it doesn't appear to have any breaking changes from 0.5.1. The main potential issue is 1.0.0 requires Dart: 3.4.0+

maRci002 commented 1 month ago

As you can see in https://pub.dev/packages/web/changelog (and it was explained in already 2 issues)

Require Dart ^3.4.0.

We are not going to drop support for Dart < 3.4.0 right away. If you have an issue with this, you can use

dependency_overrides:
  web: ^1.0.0

@Lyokone Flutter updated its flagship packages to web: ">=0.5.1 <2.0.0" (flutter/packages#7202).

They faced a similar issue as this one: flutter/flutter#151981.

priyesh-bit commented 1 month ago

Conflicting with share, filepicker, and more dependencies. Update it ASAP please

kevmoo commented 1 month ago

I'm asking around about this. Thanks for your patience!

Lyokone commented 1 month ago

We have released a new version of every plugin that requires web with support for web: 1.0.0. It should appear really soon in a pub.dev near you. Thanks for your patience.