freedelity / flutter_native_barcode_scanner

Fast barcode/QR scanner flutter plugin using PlatformView and processing on native side
https://pub.dev/packages/native_barcode_scanner
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

Error: PlatformException while using the library with FlutterFragment (Android) #27

Open frqarshed opened 3 months ago

frqarshed commented 3 months ago

I am getting below error while using the barcode scanner with FlutterFragment (works fine with FlutterActivity).

E  [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
                                                                                                    #0      InstanceManagerHostApi.clear (package:camera_android_camerax/src/camerax_library.g.dart:315:7)
                                                                                                    <asynchronous suspension>
ndusart commented 3 months ago

Hi @frqarshed ,

We are not used to projects embedding Flutter fragment in an Android Activity. Do you have a small project example that we can test on ?

Note that our plugin needs a reference to the Activity. So check that you didn't call .shouldAttachEngineToActivity(false) when creating the fragment.

frqarshed commented 2 months ago

CameraTestExample.zip

@ndusart Attached is a minimum sample and steps to reproduce are mentioned in a text file.