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

Deprecate MLKit for iOS #1225

Open
8 of 15 tasks
navaronbracke opened this issue Oct 23, 2024 · 13 comments
Open
8 of 15 tasks

Deprecate MLKit for iOS #1225

navaronbracke opened this issue Oct 23, 2024 · 13 comments
Assignees
Labels
ios Platform iOS macos Platform macos

Comments

@navaronbracke
Copy link
Collaborator

navaronbracke commented Oct 23, 2024

mobile_scanner currently uses MLKit on both iOS and Android.

However, for iOS there is a first-party library, namely the Vision API from Apple.
We already use this implementation for MacOS.

We should switch iOS over to use that implementation, which brings a bunch of improvements.
The following checklist lists the points that we should tackle when doing this migration:

Nice to have also:

@juliansteenbakker
Copy link
Owner

I have created a first draft/beta of a shared ios & macos implementation of the Vision API. Please see ios-vision for the current code. It is working right now, but still needs some work on some of the features like zoom control. I will update this in the comming days.

@P0labrD
Copy link

P0labrD commented Oct 28, 2024

Hello @juliansteenbakker
My project would very much benefit from this change, I thank you for it 🙏
If you need any help to fasten the new release, I'd be happy to help 🙂

@juliansteenbakker
Copy link
Owner

I have uploaded a new version, v7.0.0-beta.2, with some fixes. Feel free to try it out!

@RutgerVleuten
Copy link

Just tested an integration of v7.0.0-beta.3, no issues found so-far ... looking forward to the public release!

@dincerkizildere
Copy link

Hello, is there any specific date set for the general release of version 7.0.0?

@lpl-code-github
Copy link

刚刚测试了 v7.0.0-beta.3 的集成,到目前为止没有发现任何问题...期待公开发布!

When using analyzeImage to analyze a QR code of an image, it will remain in 'await' and will not proceed further. #1244

@LeopardHowl
Copy link

Oh....
where are you from @navaronbracke? Can you cooperate with us as soon as possible?

@navaronbracke
Copy link
Collaborator Author

@topdeveloper1219 Anyone is free to use the v7 beta. As for the issue with analyze image, I'd have to look into it. But if you do find why it isn't completing after the await, feel free to submit a pull request

@chenfisher
Copy link

chenfisher commented Dec 28, 2024

@navaronbracke
Exception in analyzeImage

mobile_scanner: ^7.0.0-beta.3

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: MobileScannerBarcodeException(Could not create inference context)
#0      MethodChannelMobileScanner.analyzeImage (package:mobile_scanner/src/method_channel/mobile_scanner_method_channel.dart:191:9)

Running on iPhone 16 Pro simulator, iOS 18.2, arm64 included

❯ flutter doctor                          
[✓] Flutter (Channel stable, 3.24.1, on macOS 15.2 24C101 darwin-arm64, locale en-IL)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)

Thanks

@navaronbracke
Copy link
Collaborator Author

@chenfisher Thanks for the stacktrace! Do you have the sample file that this occurred with?

@navaronbracke
Copy link
Collaborator Author

navaronbracke commented Dec 28, 2024

@chenfisher Turns out that analyzeImage is not supported on the iOS Simulator, without some tweaks: https://forums.developer.apple.com/forums/thread/696714

@ua741
Copy link

ua741 commented Jan 1, 2025

Is there any plan to deprecate MLKit for Android as well? F-droid currently doesn't allow any app with dependency on MLKit.
Related mrousavy/react-native-vision-camera#2371

@navaronbracke
Copy link
Collaborator Author

@ua741 We currently do not have plans to deprecate MLKit for Android. If there is a viable alternative that provides significant improvements (ZXing for Android could be considered, but as stated in the linked thread, it is not as fast as MLKit), then that can be revisited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ios Platform iOS macos Platform macos
Projects
None yet
Development

No branches or pull requests

9 participants