juliansteenbakker / mobile_scanner

A universal scanner for Flutter based on MLKit. Uses CameraX on Android and AVFoundation on iOS.
BSD 3-Clause "New" or "Revised" License
745 stars 444 forks source link

Dependency issue with mobile_scanner 5.0.0-beta.2 and web ^0.5.1 #995

Closed PROJASO closed 1 month ago

PROJASO commented 1 month ago

Hello,

I have been using 'mobile_scanner 4.0.1' in my Flutter project and it has been working well. I wanted to try out 'mobile_scanner 5.0.0-beta.2' to manually handle the lifecycle. However, I'm encountering a dependency issue when I add 'mobile_scanner 5.0.0-beta.2' to my project. The error message I receive is as follows:

"Resolving dependencie … And because firebase_core_web 2.12.0 depends on web ^0.5.1 and mobile_scanner >=5.0.0-beta.2 depends on web ^0.4.0, firebase_crashlytics ^3.4.19 is incompatible with mobile_scanner >=5.0.0-beta.2"

From my understanding, both firebase_core_web and mobile_scanner should work with web ^0.5.1 as long as it's less than '1.0.0'. Could you please help me understand why this conflict is occurring?

Thanks in advance

utamori commented 1 month ago

The issue is caused by the fact that this commit downgrades the version of the web package.

https://github.com/juliansteenbakker/mobile_scanner/commit/382a8b6de4324aedf932bfb0b5255c3179f4ab7a#diff-8b7e9df87668ffa6a04b32e1769a33434999e54ae081c52e5d943c541d4c0d25R28

The issue does not occur in version 5.0.0-beta.1

mobile_scanner: 5.0.0-beta.1

navaronbracke commented 1 month ago

@utamori is right here. Should we encourage users to upgrade to Flutter 3.19.0 when using mobile_scanner 5.0.0 ?

utamori commented 1 month ago

I'm not familiar with Flutter Web, but I've heard that Dart 3.3 has some breaking changes for Flutter Web.

For example, http package is now mandatory for Dart 3.3 and web v5 with minor version upgrades https://pub.dev/packages/http/changelog#121

Same with firebase_core_web, etc.

That makes me think that mobile_scanner requiring Dart 3.3 and web v5 in a major version upgrade is not a problem.