flutter-ml / google_ml_kit_flutter

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

App crash #565

Open sivasankarp01 opened 7 months ago

sivasankarp01 commented 7 months ago

Future detectFaces(InputImage inputImage, pickedFile) async { try {

if (pickedFile != null && pickedFile.path.isNotEmpty) {
  final List<Face> faces = await _faceDetector.processImage(inputImage);

  if (faces.length == 1 && faces[0].trackingId != null) {}
}catch(e){}

final List faces = await _faceDetector.processImage(inputImage);

this process image function causing this issue

While uploading some high quality images it crashes the app , i tried try catch also but its keep crashing my app.

Any solutions for this ?????

Rosco89 commented 6 months ago

Your TryCatch block won't catch native exceptions. Try runZoneGuarded to see what is the problem:

runZonedGuarded<Future<void>>(() async {
   if (pickedFile != null && pickedFile.path.isNotEmpty) {
     final List<Face> faces = await _faceDetector.processImage(inputImage);
     if (faces.length == 1 && faces[0].trackingId != null) {}
   }
}, (error, stack) => print(error));
maxmitz commented 6 months ago

I had the same problem with text recognition on iOS. I tried to runZoneGuarded but did not get any information from there. Are there other ways to debug this?

lala-naibova commented 6 months ago

I had the same problem with text recognition on iOS, too

P.S : I have tried on iphone 7, now, changed device to iphone 13 and have updated lates version, everything works okay

sivasankarp01 commented 5 months ago

I had the same problem with text recognition on iOS, too

P.S : I have tried on iphone 7, now, changed device to iphone 13 and have updated lates version, everything works okay

What abt Android??