拍照报错问题

来源:6-16 拍照APP开发-图片获取与图片展示【实战尝鲜】

糖炒果栗

2020-03-30

拍照获取不到图片 报错如下 ???????

W/Binder (10675): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: Binder:10675_4
W/Binder (10675): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:807)
W/Binder (10675): at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:740)
W/Binder (10675): at io.flutter.embedding.engine.dart.DartMessengerReply.reply(DartMessenger.java:156)W/Binder(10675):atio.flutter.plugin.common.MethodChannelReply.reply(DartMessenger.java:156) W/Binder (10675): at io.flutter.plugin.common.MethodChannelReply.reply(DartMessenger.java:156)W/Binder(10675):atio.flutter.plugin.common.MethodChannelIncomingMethodCallHandler$1.success(MethodChannel.java:225)
W/Binder (10675): at io.flutter.plugins.imagepicker.ImagePickerDelegate.finishWithSuccess(ImagePickerDelegate.java:540)
W/Binder (10675): at io.flutter.plugins.imagepicker.ImagePickerDelegate.handleImageResult(ImagePickerDelegate.java:505)
W/Binder (10675): at io.flutter.plugins.imagepicker.ImagePickerDelegate.access$000(ImagePickerDelegate.java:66)
W/Binder (10675): at io.flutter.plugins.imagepicker.ImagePickerDelegate$4.onPathReady(ImagePickerDelegate.java:470)
W/Binder (10675): at io.flutter.plugins.imagepicker.ImagePickerDelegate$31.onScanCompleted(ImagePickerDelegate.java:160)W/Binder(10675):atandroid.media.MediaScannerConnection1.onScanCompleted(ImagePickerDelegate.java:160) W/Binder (10675): at android.media.MediaScannerConnection1.onScanCompleted(ImagePickerDelegate.java:160)W/Binder(10675):atandroid.media.MediaScannerConnectionClientProxy.onScanCompleted(MediaScannerConnection.java:204)
W/Binder (10675): at android.media.MediaScannerConnection1.scanCompleted(MediaScannerConnection.java:53)W/Binder(10675):atandroid.media.IMediaScannerListener1.scanCompleted(MediaScannerConnection.java:53) W/Binder (10675): at android.media.IMediaScannerListener1.scanCompleted(MediaScannerConnection.java:53)W/Binder(10675):atandroid.media.IMediaScannerListenerStub.onTransact(IMediaScannerListener.java:61)
W/Binder (10675): at android.os.Binder.execTransact(Binder.java:726)

写回答

1回答

CrazyCodeBoy

2020-04-02

换成真机试一下呢,也可参考下这块的课程源码检查下你的代码实现看是否有出入的地方:https://git.imooc.com/coding-321/flutter_trip/src/master/demo/flutter_base_demo/lib/photo_app_page.dart


0
0

Flutter从入门到进阶 实战携程网App 一网打尽核心技术

解锁Flutter开发新姿势,,系统掌握Flutter开发核心技术。

4788 学习 · 3270 问题

查看课程