azihsoyn / flutter_mlkit

A Flutter plugin to use the Firebase ML Kit.
MIT License
392 stars 91 forks source link

App crashes when detecting text. #90

Open RBSoftwareBR opened 4 years ago

RBSoftwareBR commented 4 years ago

[ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.NoSuchMethodError: No direct method <init>(Ljava/io/InputStream;)V in class Landroid/media/ExifInterface; or its super classes (declaration of 'android.media.ExifInterface' appears in /system/framework/framework.jar) at com.azihsoyn.flutter.mlkit.MlkitPlugin.getRotationAngle(MlkitPlugin.java:736) at com.azihsoyn.flutter.mlkit.MlkitPlugin.onMethodCall(MlkitPlugin.java:141) at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231) at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93) at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:323) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:7230) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env).

Here's the code.

FirebaseVisionTextDetector detector = FirebaseVisionTextDetector .instance; List<VisionText> results = await detector.detectFromBinary(b)