Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PlatformException(already_active, Image picker is already active, null) on huawei y5

Tags:

flutter

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)

How can I resolve this image picker dependency error?

like image 479
Lunga Avatar asked Oct 15 '25 18:10

Lunga


1 Answers

Uninstall the app then install again, if issue still persist maybe you are overriding any method on MainActivity with using super, like for me adding super onActivity result helped, which I found from this link.

Ref link 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.
like image 169
Anas Iqbal Avatar answered Oct 17 '25 09:10

Anas Iqbal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!