Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios部分设备扫码会闪退 #27

Open
git-boya opened this issue Jan 25, 2022 · 12 comments
Open

ios部分设备扫码会闪退 #27

git-boya opened this issue Jan 25, 2022 · 12 comments
Labels
wontfix This will not be worked on

Comments

@git-boya
Copy link

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
Copy link
Author

补充一下日志
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

@arcticfox1919
Copy link
Owner

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

@git-boya
Copy link
Author

git-boya commented Jan 25, 2022

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

@arcticfox1919
Copy link
Owner

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

@git-boya
Copy link
Author

git-boya commented Feb 9, 2022

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

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

@shenlanchenwei
Copy link

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

@arcticfox1919 arcticfox1919 added the wontfix This will not be worked on label May 19, 2022
@laisangbum
Copy link

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

  • thread 可否支持将扫描的view嵌入flutter widget中 #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

@k3v1n-uncle
Copy link

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

@k3v1n-uncle
Copy link

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

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

@k3v1n-uncle
Copy link

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

@KarlMarxs
Copy link

KarlMarxs commented Dec 5, 2022

这个问题尝试使用下面方式解决了,大家可以参考:比如,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同学可以看看原因。

希望可以帮到大家

@menshen
Copy link

menshen commented Oct 4, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

7 participants