E/flutter (15907): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(already_active, Image picker is already active, null)
E/flutter (15907): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (15907): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33)
E/flutter (15907): <asynchronous suspension>
E/flutter (15907): #2 ImagePicker.pickImage (package:image_picker/image_picker.dart:59:40)
如何解决此图像选择器相关性错误?
答案 0 :(得分:2)
卸载应用程序然后重新安装,如果问题仍然存在,也许您正在使用 super 覆盖 MainActivity 上的任何方法,例如对我来说添加 super onActivity 结果有帮助,这是我从这个链接找到的。
参考链接https://github.com/flutter/flutter/issues/19103#issuecomment-412647536
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
super.onActivityResult(requestCode, resultCode, data); // had to add this line.
答案 1 :(得分:0)