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

TextDetector works ok on Android but doesn't work on iOS #207

Closed
kodol73 opened this issue Mar 3, 2022 · 2 comments
Closed

TextDetector works ok on Android but doesn't work on iOS #207

kodol73 opened this issue Mar 3, 2022 · 2 comments

Comments

@kodol73
Copy link

kodol73 commented Mar 3, 2022

Hi,

TextDetectorV2 works ok on Android.
However, I have the following error on iOS using GoogleMlKit.vision.textDetectorV2()


[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method vision#startTextDetectorV2 on channel google_ml_kit)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)

#1 TextDetectorV2.processImage (package:google_ml_kit/src/vision/text_detector.dart:46:20)


textRecognizer = GoogleMlKit.vision.textDetectorV2();
final File? imageFile = await getImage(ImageSource.gallery);

if(imageFile != null) {
  final inputImage = InputImage.fromFile(imageFile);
  final RecognisedText recognisedText = await textRecognizer.processImage(inputImage);

  print(recognisedText.toString());
}

If I try using textDetector() instead of textDetectorV2(), the following error occurs when print recognisedText.toString()


[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: RangeError (index): Invalid value: Valid value range is empty: 0


I added the following on Podfile
pod 'GoogleMLKit/TextRecognition', '2.2.0'

My development environment is as followes
iOS 14.7.1
Xcode 12.4

Please help me to solve this issue
Thanks in advance

@mahmoud-atef-eden
Copy link

any solutions ??

@fbernaly
Copy link
Collaborator

@kodol73 , @mahmoud-atef-eden : try our new plugin: google_mlkit_text_recognition.

We have split google_ml_kit in multiples plugins to allow devs to only include to their apps only what they need.

More info here:

https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_ml_kit

https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_text_recognition

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

No branches or pull requests

3 participants