arcticfox1919 / flutter-scankit

Flutter QR code scanning
MIT License
158 stars 58 forks source link

queue = 'ProviderImageSurfaceCacheQueue', stop reason = EXC_BAD_ACCESS #62

Open sparkmobi opened 1 year ago

sparkmobi commented 1 year ago

hello

I am getting this error after approving the camera permission

thread #43, queue = 'ProviderImageSurfaceCacheQueue', stop reason = EXC_BAD_ACCESS (code=1, address=0x127b00000) frame #0: 0x000000022c20310c libsystem_platform.dylib_platform_memmove + 188 libsystem_platform.dylib: -> 0x22c20310c <+188>: ldnp q0, q1, [x1] 0x22c203110 <+192>: add x1, x1, #0x20 0x22c203114 <+196>: subs x2, x2, #0x20 0x22c203118 <+200>: b.hi 0x22c203104 ; <+180>

here is my code example

return Scaffold( body: SafeArea( child: Stack( children: [ ScanKitWidget( controller: _controller, continuouslyScan: true, boundingBox: rect, ), Align( alignment: Alignment.topCenter, child: GlassContainer.clearGlass( blur: 8, borderColor: Colors.transparent, margin: EdgeInsets.only(top: 60.h), elevation: 2, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(5), color: Colors.white12, height: 50.h, width: 150.w, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ IconButton( onPressed: () { _controller.switchLight(); }, icon: const Icon( Icons.lightbulb_outline_rounded, color: Colors.white, size: 25, )), SizedBox( width: 0.075.sw, ), IconButton( onPressed: () async { _controller.pickPhoto(); }, icon: Image.asset( 'assets/images/photo.png', width: 25, height: 25, color: Colors.white, ), ) ], ), ), ), Align( alignment: Alignment.center, child: CustomPaint( painter: QrScanBoxPainter( boxLineColor: Colors.cyanAccent, animationValue: _animationController?.value ?? 0, isForward: _animationController?.status == AnimationStatus.forward, ), child: SizedBox( width: qrScanSize, height: qrScanSize, ), ), ),

                  ],
                )),
          ),
      ],
    ),
  ),
);

I even tested the example project then clicked on customized view and also crashed

mdddj commented 1 year ago

有同样的问题,controller.dispose 函数在ios上面会闪退 ,2.0.0

arcticfox1919 commented 1 year ago

@sparkmobi If you are using the flutter_easy_permission plugin to request permissions, then you may want to try using a different Flutter plugin, as flutter_easy_permission is not actively maintained and may have compatibility issues on higher versions of iOS.

sparkmobi commented 1 year ago

using

no I am not using this library, i run your example project and still getting the same error

arcticfox1919 commented 1 year ago

@sparkmobi What I mean is that I am using the flutter_easy_permission plugin in my example project. I can't reproduce the issue with my iOS device here, perhaps you can provide, for reference, the model number of the device reporting the error, the system version, and the Flutter SDK version. I think this issue is most likely caused by not successfully obtaining access to the camera, and you should call ScanKit after obtaining authorization.