flutter-scankit icon indicating copy to clipboard operation
flutter-scankit copied to clipboard

ios部分设备扫码会闪退

Open git-boya opened this issue 2 years ago • 12 comments

flutter版本:2.5 ios版本:15.1 错误日志: libc++abi: terminating with uncaught exception of type zxing::Exception

  • thread #46, queue = 'HmsImageProcesser', stop reason = signal SIGABRT frame #0: 0x00000001bca769e8 libsystem_kernel.dylib__pthread_kill + 8 libsystem_kernel.dylib__pthread_kill: -> 0x1bca769e8 <+8>: b.lo 0x1bca76a04 ; <+36> 0x1bca769ec <+12>: stp x29, x30, [sp, #-0x10]! 0x1bca769f0 <+16>: mov x29, sp 0x1bca769f4 <+20>: bl 0x1bca72670 ; cerror_nocancel Target 0: (Runner) stopped.

git-boya avatar Jan 25 '22 08:01 git-boya

补充一下日志 2022-01-25 16:50:19.176417+0800 Runner[5619:615099] flutter: VERBOSE [V] didPush route: /home/scankit libc++abi: terminating with uncaught exception of type zxing::Exception dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib terminating with uncaught exception of type zxing::Exception dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib terminating with uncaught exception of type zxing::Exception

git-boya avatar Jan 25 '22 08:01 git-boya

使用的是自定义扫码还是简单扫码?闪退的设备是什么型号?

arcticfox1919 avatar Jan 25 '22 10:01 arcticfox1919

自定义界面扫码,iphoneX XR都会奔溃 6s和iphone8没有问题

git-boya avatar Jan 25 '22 11:01 git-boya

@git-boya 这可能是华为扫码库的BUG,可能与具体手机的屏幕大小有关,据其他人反馈,在其中几款机型上,设置不同的自定义扫描区域大小,其中有些值会导致crash,建议你可以使用不同的扫描区域大小来测试该问题

arcticfox1919 avatar Jan 26 '22 13:01 arcticfox1919

@git-boya 这可能是华为扫码库的BUG,可能与具体手机的屏幕大小有关,据其他人反馈,在其中几款机型上,设置不同的自定义扫描区域大小,其中有些值会导致crash,建议你可以使用不同的扫描区域大小来测试该问题

我用插件的example示例项目运行,在iphoneX上也有同样的问题

git-boya avatar Feb 09 '22 02:02 git-boya

同样问题+1,请问有解决方法吗?

shenlanchenwei avatar Feb 21 '22 02:02 shenlanchenwei

我使用iphone X 也出现问题, 使用自定义扫码,一打开就闪退。 默认扫码没问题 libc++abi: terminating with uncaught exception of type zxing::Exception

  • thread #3, queue = 'HmsImageProcesser', stop reason = signal SIGABRT frame #0: 0x00000001babe7bbc libsystem_kernel.dylib__pthread_kill + 8 libsystem_kernel.dylib__pthread_kill: -> 0x1babe7bbc <+8>: b.lo 0x1babe7bd8 ; <+36> 0x1babe7bc0 <+12>: stp x29, x30, [sp, #-0x10]! 0x1babe7bc4 <+16>: mov x29, sp 0x1babe7bc8 <+20>: bl 0x1babe360c ; cerror_nocancel

laisangbum avatar Jun 04 '22 03:06 laisangbum

+1,用的demo里的自定义布局,iPhonex闪退,iPhone6 plus和iPhone12 正常

k3v1n-uncle avatar Jul 07 '22 01:07 k3v1n-uncle

@git-boya 这可能是华为扫码库的BUG,可能与具体手机的屏幕大小有关,据其他人反馈,在其中几款机型上,设置不同的自定义扫描区域大小,其中有些值会导致crash,建议你可以使用不同的扫描区域大小来测试该问题

请问扫码区域是指boundingBox: rect,这个吗

k3v1n-uncle avatar Jul 07 '22 01:07 k3v1n-uncle

我同事的xr 和 xs 正常,这是什么情况

k3v1n-uncle avatar Jul 07 '22 02:07 k3v1n-uncle

这个问题尝试使用下面方式解决了,大家可以参考:比如,Demo中这段代码, var pixelSize = boxSize * window.devicePixelRatio; var left = screenWidth/2 - pixelSize/2; var top = screenHeight/2 - pixelSize/2; var right = screenWidth/2 + pixelSize/2; var bottom = screenHeight/2 + pixelSize/2; var rect = Rect.fromLTRB(left, top, right, bottom);

Demo中传递给Scankit的Rect使用的物理大小,单位是px; 这个在android设备是有效的。 在ios尝试使用逻辑大小,也就在demo中代码left=(screenWidth/2 - pixelSize/2)/ window.devicePixelRatio。测试有效--ios15.5 se

具体原因不清楚,没有时间去看,另外技术栈是Android,有ios同学可以看看原因。

希望可以帮到大家

KarlMarxs avatar Dec 05 '22 08:12 KarlMarxs

我去掉了创建ScanKitWidget时的boundinBox参数后没问题了 修改前: ScanKitWidget( controller: _controller, continuouslyScan: false, boundingBox: rect) 修改后: ScanKitWidget( controller: _controller, continuouslyScan: false,),

menshen avatar Oct 04 '23 03:10 menshen