塞纳河边攻城狮
塞纳河边攻城狮
  • 发布:2016-02-19 19:32
  • 更新:2018-01-17 10:07
  • 阅读:3761

【报Bug】IOS原生混合项目,右划关闭H5页面程序崩溃(闪退)

分类:5+ SDK

IOS原生混合项目,有4个栏目,
其中有两个栏目是用H5开发的,都采用独立应用方式集成,
点击打开其中任何一个,右划关闭都会出现闪退。

SDK报错:

AppDelegate.mm:166 clientId : 863138e7c4961c25d5e34669d2c21693
2016-02-19 19:20:15.149 Pocket48-Member[26003:739925] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(
0 CoreFoundation 0x00000001167cde65
exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000116243deb objc_exception_throw + 48
2 CoreFoundation 0x000000011668c652 -[NSPlaceholderArray initWithObjects:count:] + 290
3 CoreFoundation 0x00000001166e97e4 +[NSArray arrayWithObjects:count:] + 52
4 Pocket48-Member 0x000000010f6548f3 -[PDRCoreAppManager screenEdgePan:getParams:] + 222
5 Pocket48-Member 0x000000010f643687 -[H5CoreScreenEdgePan handleScreenEdgePan:] + 356
6 UIKit 0x0000000111cd5e73 _UIGestureRecognizerSendTargetActions + 153
7 UIKit 0x0000000111cd24e5 _UIGestureRecognizerSendActions + 162
8 UIKit 0x0000000111cd04e2 -[UIGestureRecognizer updateGestureWithEvent:buttonEvent:] + 843
9 UIKit 0x0000000111cd89a0
UIGestureRecognizerUpdate_block_invoke904 + 79
10 UIKit 0x0000000111cd883e _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 342
11 UIKit 0x0000000111cc6101 _UIGestureRecognizerUpdate + 2634
12 UIKit 0x000000011185df8a -[UIWindow _sendGesturesForEvent:] + 1137
13 UIKit 0x000000011185f1c0 -[UIWindow sendEvent:] + 849
14 UIKit 0x000000011180db66 -[UIApplication sendEvent:] + 263
15 UIKit 0x00000001117e7d97 _UIApplicationHandleEventQueue + 6844
16 CoreFoundation 0x00000001166f9a31 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
17 CoreFoundation 0x00000001166ef95c CFRunLoopDoSources0 + 556
18 CoreFoundation 0x00000001166eee13
CFRunLoopRun + 867
19 CoreFoundation 0x00000001166ee828 CFRunLoopRunSpecific + 488
20 GraphicsServices 0x0000000117673ad2 GSEventRunModal + 161
21 UIKit 0x00000001117ed610 UIApplicationMain + 171
22 Pocket48-Member 0x000000010f202a4f main + 111
23 libdyld.dylib 0x00000001170c892d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

2016-02-19 19:32 负责人:无 分享
已邀请:
shiying

shiying

你好,你的问题解决了吗 ,当时是怎么解决的呢

z***@qq.com

z***@qq.com

关闭手势:

import "Aspects.h" //pod Aspects

[NSClassFromString(@"H5CoreScreenEdgePan") aspect_hookSelector:@selector(resetGestureRecognizerView:) withOptions:AspectPositionInstead usingBlock:^(id<AspectInfo>info){
} error:nil];

天狐

天狐

这个问题出现在隐藏Navgationbar并且子类化UINavgationControler里面开启侧滑手势的页面。
dcloud把UIScreenEdgePanGestureRecognizer手势加在了Navgation中。。和侧滑手势冲突了。
子类化UINavgationControler 手势的delegate中返回YES解决

  • (BOOL)gestureRecognizer:(UIGestureRecognizer )gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer )otherGestureRecognizer {
    if ([gestureRecognizer isKindOfClass:[UIScreenEdgePanGestureRecognizer class]]) {
    NSLog(@"gestureRecognizer shouldBeRequiredToFailByGestureRecognizer UIScreenEdgePanGestureRecognizer");
    }
    return YES;
    }

该问题目前已经被锁定, 无法添加新回复