拍照demo获取不到照片

来源:6-15 拍照APP开发-拍照配置与AndroidX兼容处理【实战尝鲜】

叶乔

2021-03-23

5-15 实战课程中再执行了拍照后,获取不到图片
报错如下:
W/Binder ( 4303): Caught a RuntimeException from the binder stub implementation.
W/Binder ( 4303): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: Binder:4303_4
W/Binder ( 4303): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:992)
W/Binder ( 4303): at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:779)
W/Binder ( 4303): at io.flutter.embedding.engine.dart.DartMessengerReply.reply(DartMessenger.java:144)W/Binder(4303):atio.flutter.plugin.common.MethodChannelReply.reply(DartMessenger.java:144) W/Binder ( 4303): at io.flutter.plugin.common.MethodChannelReply.reply(DartMessenger.java:144)W/Binder(4303):atio.flutter.plugin.common.MethodChannelIncomingMethodCallHandler$1.success(MethodChannel.java:238)
W/Binder ( 4303): at io.flutter.plugins.imagepicker.ImagePickerDelegate.finishWithSuccess(ImagePickerDelegate.java:462)
W/Binder ( 4303): at io.flutter.plugins.imagepicker.ImagePickerDelegate.handleImageResult(ImagePickerDelegate.java:431)
W/Binder ( 4303): at io.flutter.plugins.imagepicker.ImagePickerDelegate.access$000(ImagePickerDelegate.java:65)
W/Binder ( 4303): at io.flutter.plugins.imagepicker.ImagePickerDelegate$4.onPathReady(ImagePickerDelegate.java:398)
W/Binder ( 4303): at io.flutter.plugins.imagepicker.ImagePickerDelegate$31.onScanCompleted(ImagePickerDelegate.java:150)W/Binder(4303):atandroid.media.MediaScannerConnection1.onScanCompleted(ImagePickerDelegate.java:150) W/Binder ( 4303): at android.media.MediaScannerConnection1.onScanCompleted(ImagePickerDelegate.java:150)W/Binder(4303):atandroid.media.MediaScannerConnectionClientProxy.onScanCompleted(MediaScannerConnection.java:201)
W/Binder ( 4303): at android.media.MediaScannerConnection1.scanCompleted(MediaScannerConnection.java:54)W/Binder(4303):atandroid.media.IMediaScannerListener1.scanCompleted(MediaScannerConnection.java:54) W/Binder ( 4303): at android.media.IMediaScannerListener1.scanCompleted(MediaScannerConnection.java:54)W/Binder(4303):atandroid.media.IMediaScannerListenerStub.onTransact(IMediaScannerListener.java:97)
W/Binder ( 4303): at android.os.Binder.execTransactInternal(Binder.java:1028)
W/Binder ( 4303): at android.os.Binder.execTransact(Binder.java:1001)

写回答

1回答

叶乔

提问者

2021-03-23

更换新版image_picker已经解决!

0
1
CrazyCodeBoy
估计是旧版的兼容问题。
2021-03-24
共1条回复

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

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

4788 学习 · 3270 问题

查看课程