flutter-ml / google_ml_kit_flutter

A flutter plugin that implements Google's standalone ML Kit
MIT License
995 stars 752 forks source link

Errors upon downloading translation on source app #633

Closed mcrrobinson closed 6 months ago

mcrrobinson commented 6 months ago

There was another issue with one of the image based functions. So for now I commented them out because I am not focusing on them.

  1. Download the sample app.
  2. Comment out the vision detection functions because some of them have issues. Not relevant here.
    // ExpansionTile(
                  //   title: const Text('Vision APIs'),
                  //   children: [
                  //     CustomCard('Barcode Scanning', BarcodeScannerView()),
                  //     CustomCard('Face Detection', FaceDetectorView()),
                  //     CustomCard('Face Mesh Detection', FaceMeshDetectorView()),
                  //     CustomCard('Image Labeling', ImageLabelView()),
                  //     CustomCard('Object Detection', ObjectDetectorView()),
                  //     CustomCard('Text Recognition', TextRecognizerView()),
                  //     CustomCard('Digital Ink Recognition', DigitalInkView()),
                  //     CustomCard('Pose Detection', PoseDetectorView()),
                  //     CustomCard('Selfie Segmentation', SelfieSegmenterView()),
                  //     if (Platform.isAndroid)
                  //       CustomCard('Document Scanner', DocumentScannerView()),
                  //   ],
                  // ),
  3. flutter run
  4. Navigate to On-device translation
  5. Click download source or download target model.
  6. The modal shows up but the following errors are displayed to console.
    Error
    dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3  throw_
    packages/flutter/src/services/platform_channel.dart 332:7                    _invokeMethod
    dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50           <fn>
    dart-sdk/lib/async/zone.dart 1661:54                                         runUnary
    dart-sdk/lib/async/future_impl.dart 163:18                                   handleValue
    dart-sdk/lib/async/future_impl.dart 847:44                                   handleValueCallback
    dart-sdk/lib/async/future_impl.dart 876:13                                   _propagateToListeners
    dart-sdk/lib/async/future_impl.dart 652:5                                    [_completeWithValue]
    dart-sdk/lib/async/future_impl.dart 722:7                                    callback
    dart-sdk/lib/async/schedule_microtask.dart 40:11                             _microtaskLoop
    dart-sdk/lib/async/schedule_microtask.dart 49:5                              _startMicrotaskLoop
    dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7           <fn>

    image

Platform (please complete the following information):

Update: I have checked and it runs fine using an emulator. It must be something to do with running it on Chrome.

fbernaly commented 6 months ago

Are you running this in the web?

mcrrobinson commented 6 months ago

Hi,

Just saw the notice that it doesn't work in the web. Apologies.

Thanks, Matt

fbernaly commented 6 months ago

No, it is in the README:

https://github.com/flutter-ml/google_ml_kit_flutter?tab=readme-ov-file

Screenshot 2024-05-30 at 10 20 26 AM

https://developers.google.com/ml-kit