openfoodfacts / smooth-app

🤳🥫 The new Open Food Facts mobile application for Android and iOS, crafted with Flutter and Dart
https://world.openfoodfacts.org/open-food-facts-mobile-app?utm_source=off&utf_medium=web&utm_campaign=github-repo
Apache License 2.0
800 stars 275 forks source link

Outdated play-services-mlkit-barcode-scanning dependency #1880

Closed g123k closed 2 years ago

g123k commented 2 years ago

What

We use a forked version of google_ml_barcode_scanner because the maintainer never answered @cli1005's PR.

In addition, the dependency used is outdated. Eg on Android: com.google.android.gms:play-services-mlkit-barcode-scanning:16.2.1, whereas the latest version is 18.0.0 and brings:

What should we do?

M123-dev commented 2 years ago

I wouldn't add it to smoothie as it's not a smoothie own feature and would probably add 1k+ lines, but having a maintance fork would be good

cli1005 commented 2 years ago

It seems that issues of code 128B 128C are not the same as UPC-A, but it is great if we could update the dependency, I just have a little question, will it work on ios as well 😄 ?

g123k commented 2 years ago

Yes it will. Ok then I fork the project as an OFF one

M123-dev commented 2 years ago

@g123k I just rememberd we are actually not using the real plugin, but a fork of it, which we used to keep the bundle size small as the main package included all ml-kit features not just barcode scanning.

Looking at the main package google_ml_kit it looks like he now split them up himself, so we can go back to using it. Also it well maintained (last update 15 days ago, last commit 8 days ago)

It doesn't yet use version 18 (17.0.2) but I guess a update PR will get merged much faster there, but we can still fork it and use the openfoodfacts fork for contributing to bharat-biradar/Google-Ml-Kit-plugin and use our fork in smoothie

g123k commented 2 years ago

Ok let me test with this plugin instead I put my PR on hold

g123k commented 2 years ago

Everything works like a charm with the new dependency. Excellent idea @M123-dev!

I will create a new PR to make the switch. It also already uses the latest version (18.x is for the non-embedded version)

Note: the cropped image algorithm is still crashing on iOS