如何处理```Failed assertion:line 111 pos 12:'image!= null':not true`''

时间:2020-04-17 06:56:44

标签: flutter exception detect face

我尝试通过firebase_ml_vision使用面部检测器程序包,这是代码

detectFaces(File image) async {
    final myimage = FirebaseVisionImage.fromFile(image);
    final faceDetector = FirebaseVision.instance.faceDetector(
        FaceDetectorOptions(
            mode: FaceDetectorMode.accurate,
            enableLandmarks: true,
            enableClassification: true));

问题是...每当我单击手机上的后退按钮时,我总是会paused on exception

Exception has occurred.
_AssertionError ('package:firebase_ml_vision/src/firebase_vision.dart': Failed assertion: line 111 pos 12: 'image != null': is not true.)

有没有一种方法可以防止异常暂停

0 个答案:

没有答案