Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MissingPluginException: MissingPluginException(No implementation found for method vision#startBarcodeScanner on channel g... #1155

Closed
sentry-io bot opened this issue Feb 20, 2022 · 14 comments
Labels
🍎 iOS iOS specific issues or PRs 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion…

Comments

@sentry-io
Copy link

sentry-io bot commented Feb 20, 2022

Sentry Issue: SMOOTHIE-T3

MissingPluginException: MissingPluginException(No implementation found for method vision#startBarcodeScanner on channel google_ml_barcode_scanner)
  File "barcode_scanner.dart", line 21, in BarcodeScanner.processImage
  File "ml_kit_scan_page.dart", line 226, in MLKitScannerPageState._processCameraImage
@teolemon teolemon added 🍎 iOS iOS specific issues or PRs 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion… labels Feb 20, 2022
@cli1005
Copy link
Contributor

cli1005 commented Feb 28, 2022

Issue has been reproduced on my mobile phone iOS (launched locally with current code, not via TestFlight), which might be caused by the package google_ml_barcode_scanner, since I manage to scan continuously by switching to google_ml_kit(0.7.3), but configuration of Firebase in Podfile and AppDelegated.swift are necessary to make it work.

google_ml_barcode_scanner might be an old version of GoogleMLKit/BarcodeScanning, more détails could be found as followings:

@M123-dev
Copy link
Member

M123-dev commented Mar 1, 2022

Thanks for sharing @cli1005, yes google_ml_barcode_scanner is indeed a version of google_ml_kit but it excluded all the other ML-Kit features in favour of the app size. Did you test google_ml_barcode_scanner with Firebase set up, this would save a lot time

@monsieurtanuki
Copy link
Contributor

@M123-dev I've lost the thread, but I believe that currently we support 2 different scanners. I assume that it was for good reasons, e.g. the first one not working properly or the second proposing interesting features.
Could we imagine to use scanner 1 for Android and scanner 2 for iOS, given the stack of issues, or is it never as simple as "scanner x always works on platform y but not always on platform z"?

@M123-dev
Copy link
Member

M123-dev commented Mar 1, 2022

@monsieurtanuki when I remeber right then both had some flaws on iOS, the old one's github repo (of the native library used) is archived so no bug fixes there, the best thing would be to fix this one here. The problem is just that I have no way to debug/reproduce so it's mostly about guessing

@monsieurtanuki
Copy link
Contributor

@M123-dev Understood. What about trying mobile_scanner (39 likes, 130 pub points, 82% popularity), which is very active ("published 5 days ago") and seems to be focusing on barcodes using ml? It sounds better than google_ml_barcode_scanner (1 like, 120 pub points, 71% popularity, published 4 months ago"), doesn't it?

@M123-dev
Copy link
Member

M123-dev commented Mar 1, 2022

@monsieurtanuki sadly it's not as easy as that since we need a lot of customization. I did a comparison in January which can be found here

As for mobile_scanner it uses ML-Kit which is certainly good for performance but doesn't support much customization out of the box, also it's just 21 days old (Feb 8) thats why it's not in the comparison

For google_ml_barcode_scanner it doesn't have much likes since it's a fork of google_ml_kit (301 likes, 130 points, 97%). The problem with using it is just that it supports nearly all ML-Kit features, so it includes all native ML-Kit libraries which increases the app by size a lot

@monsieurtanuki
Copy link
Contributor

@M123-dev Thank you for your explanations.

For google_ml_barcode_scanner it doesn't have much likes since it's a fork of google_ml_kit (301 likes, 130 points, 97%).

I guess that if developers used it and found it remotely interesting, it would have more than 1 like after more than 4 months... There are only 2 releases in google_ml_barcode_scanner:

  • 0.0.1 Initial release
  • 0.0.2 Added missing exports (4 months ago)

That's not what I call a very active project.

On the other hand, the more recent mobile_scanner is much more dynamic - obviously there was room in pub.dev for a decent barcode scanner. I'm sure its maintainer would be more than interested in new feature suggestions.

Those were just remarks from an external viewpoint.

@cli1005
Copy link
Contributor

cli1005 commented Mar 2, 2022

Thanks for sharing @cli1005, yes google_ml_barcode_scanner is indeed a version of google_ml_kit but it excluded all the other ML-Kit features in favour of the app size. Did you test google_ml_barcode_scanner with Firebase set up, this would save a lot time

Yes, I modified the file ios/Podfile, ios/Runner/AppDelegate.swift, and added a plist file GoogleServices-Info.pist in ios/Runner folder as mentioned in this reply : flutter-ml/google_ml_kit_flutter#172 (comment)

  • ios/Podfile

...
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'Firebase'
flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
end
...

  • ios/Runner/AppDelegate.swift

...
import Firebase
...
GeneratedPluginRegistrant.register(with: self)
FirebaseApp.configure()
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
...

  • GoogleServices-Info.plist
    I use a plist file of my personal firebase project, it seems that the content of this file is not important, so you could follow steps in this link https://firebase.google.com/docs/ios/setup to get un plist file.

It seems that firebase dependencies could be removed from ML kit, but it does not work with the version 0.7.3(tried 💪 => failed 😞 ):

@M123-dev
Copy link
Member

M123-dev commented Mar 2, 2022

That's unfortunate @cli1005 but I am unsure what this is caused by.

The package doesn't include the old firebase scanner (Firebase/MLVision or Firebase/MLVisionBarcodeModel) but only the new mlkit barcode scanner (GoogleMLKit/BarcodeScanning) and on the official guide for it there is nothing about adding a firebase project. https://developers.google.com/ml-kit/vision/barcode-scanning/ios?hl=en

So its likely a problem of the implementation inside the package and not from ml kit.

Best would be if we could find a way to fix it otherwise we would have to add a firebase project

@M123-dev
Copy link
Member

M123-dev commented Mar 4, 2022

I found another intersting fact, 85.96% of the occurrences happen on iOS simulator. But since we stopped sentry for debug builds a bit ago they stopped coming in. But there are still some reports coming in from real devices

cli1005 added a commit to cli1005/smooth-app that referenced this issue Mar 14, 2022
cli1005 added a commit to cli1005/smooth-app that referenced this issue Mar 16, 2022
- Use an old version of google_ml_kit to remove firebase link
M123-dev pushed a commit that referenced this issue Mar 18, 2022
* fix: #1155 - MissingPluginException (iOS scanner issue)

* fix: #1155 - MissingPluginException (iOS scanner issue)
- Use an old version of google_ml_kit to remove firebase link

* fix: #1245 - google_ml_kit build issue revert 1155
@M123-dev M123-dev reopened this Mar 18, 2022
cli1005 added a commit to cli1005/smooth-app that referenced this issue Mar 22, 2022
fix method handler in google_ml_barcode_scanner
@cli1005
Copy link
Contributor

cli1005 commented Mar 22, 2022

I made a fix in method handler of google_ml_barcode_scanner, we might use the git repo forked while waiting for my PR to be merged:

google_ml_barcode_scanner:
git:
url: https://github.com/cli1005/google_ml_barcode_scanner.git
ref: master

@M123-dev
Copy link
Member

M123-dev commented Mar 22, 2022

Heyy sounds great @cli1005 you know if this problem also exists in the main google_ml_kit package

@M123-dev
Copy link
Member

Opened a PR @cli1005

@cli1005
Copy link
Contributor

cli1005 commented Mar 30, 2022

I tested the newest version released on TestFlight, it works on my mobile(iOS15.3), does it work on yours?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍎 iOS iOS specific issues or PRs 🤳🥫 Scan We need to be able to scan on low-end, old devices, even with a bad camera, connexion…
Projects
None yet
Development

No branches or pull requests

4 participants