ios - iOS/Swift::在初始化期间,HERE map 偶尔会崩溃=> [NSCFString hac_toVariant]

标签 ios swift crash xcode8 here-ios

我目前在使用HEREMaps的两个不同项目中面临一个问题。通过NMAApplicationContext.set(...)初始化后,应用程序立即崩溃,并显示以下日志:

2017-05-02 10:15:25.372 ANIO [3574:431630]-[ NSCFString hac_toVariant]:无法识别的选择器已发送到实例0x618000027560
2017-05-02 10:15:25.403 ANIO [3574:431630] ***由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[__ NSCFString hac_toVariant]:无法识别的选择器已发送至实例0x618000027560'
***首先抛出调用堆栈:
(
0 CoreFoundation 0x000000010edccb0b __exceptionPreprocess + 171
1个libobjc.A.dylib 0x000000010e41c141 objc_exception_throw + 48
2 CoreFoundation 0x000000010ee3c134-[NSObject(NSObject)didNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010ed53840 ___forwarding_
+ 1024
4 CoreFoundation 0x000000010ed533b8 _CF_forwarding_prep_0 + 120
5 ANIO 0x000000010d67819a _Z29PathToFileInWritableDirectoryP8NSString + 19706
6 ANIO 0x000000010d6bd98c _ZN6smart518segments_intersectExxxxxxxxPxS0_ + 55445
7 ANIO 0x000000010d6cdd8a _ZNSt3__110__list_impIN6smart517OrientedPointPairINS1_7geopt_tEEENS_9allocatorIS4_EEE5clearEv + 13288
8 ANIO 0x000000010d6cd1bb _ZNSt3__110__list_impIN6smart517OrientedPointPairINS1_7geopt_tEEENS_9allocatorIS4_EEE5clearEv + 10265
9 ANIO 0x000000010d6ee8a9 _ZNSt3__16vectorI11_GLKVector2NS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE + 97469
10 ANIO 0x000000010d6ee778 _ZNSt3__16vectorI11_GLKVector2NS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE + 97164
11 ANIO 0x000000010d6ee93e _ZNSt3__16vectorI11_GLKVector2NS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE + 97618
12 ANIO 0x000000010d6ef293 _ZNSt3__16vectorI11_GLKVector2NS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE + 100007
13 ANIO 0x000000010d6ecebc _ZNSt3__16vectorI11_GLKVector2NS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE + 90832
14 libdispatch.dylib 0x00000001122c44a6 _dispatch_call_block_and_release + 12
15 libdispatch.dylib 0x00000001122ed05c _dispatch_client_callout + 8
16 libdispatch.dylib 0x00000001122cb94f _dispatch_queue_serial_drain + 221
17 libdispatch.dylib 0x00000001122cc669 _dispatch_queue_invoke + 1084
18 libdispatch.dylib 0x00000001122ceec4 _dispatch_root_queue_drain + 634
19 libdispatch.dylib 0x00000001122cebef _dispatch_worker_thread3 + 123
20 libsystem_pthread.dylib 0x0000000112684746 _pthread_wqthread + 1299
21 libsystem_pthread.dylib 0x0000000112684221 start_wqthread + 13
)
libc++ abi.dylib:以NSException类型的未捕获异常终止

有人面临同样的问题吗?任何的想法?
消除此错误的唯一方法是卸载/安装应用程序。

亲切的问候,

麦可

好的,简短更新...该错误很容易重现。

1.)从[link] https://developer.here.com/mobile-sdks/documentation/ios-starter/topics/quick-start.html下载示例代码

2)按照以下步骤包含NMAKit框架和NMAKit bundle 包

3.)生成并运行(Xcode版本8.3.2(8E2002))。目标模拟器/硬件无关紧要(尝试使用iPhone 6/7 / s模拟器和硬件)。即使使用Obj-c或Swift样本也没有任何区别。

首先,一切都很好。第二次启动会导致崩溃。

2017-05-02 13:38:34.331 HelloMap [16821:1642096]-[ NSCFString hac_toVariant]:无法识别的选择器已发送到实例0x7f80266079a0
2017-05-02 13:38:34.342 HelloMap [16821:1642096] ***由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[__ NSCFString hac_toVariant]:无法识别的选择器已发送至实例0x7f80266079a0”
***首先抛出调用堆栈:
(
0 CoreFoundation 0x000000010d9d9d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010d44ddeb objc_exception_throw + 48
2 CoreFoundation 0x000000010d9e2d3d-[NSObject(NSObject)didNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010d928cfa ___forwarding_
+ 970
4 CoreFoundation 0x000000010d9288a8 _CF_forwarding_prep_0 + 120
5 HelloMap 0x000000010cb6e9de _Z29PathToFileInWritableDirectoryP8NSString + 19706
6 HelloMap 0x000000010cbb41cc _ZN6smart518segments_intersectExxxxxxxxPxS0_ + 55445
7 HelloMap 0x000000010cbc4534 _ZNSt3__110__list_impIN6smart517OrientedPointPairINS1_7geopt_tEEENS_9allocatorIS4_EEE5clearEv + 13288
8 HelloMap 0x000000010cbc3965 _ZNSt3__110__list_impIN6smart517OrientedPointPairINS1_7geopt_tEEENS_9allocatorIS4_EEE5clearEv + 10265
9 HelloMap 0x000000010cbe5009 _ZNSt3__16vectorI11_GLKVector2NS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE + 97469
10 HelloMap 0x000000010cbe4ed8 _ZNSt3__16vectorI11_GLKVector2NS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE + 97164
11 HelloMap 0x000000010cbe509e _ZNSt3__16vectorI11_GLKVector2NS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE + 97618
12 HelloMap 0x000000010cbe59f3 _ZNSt3__16vectorI11_GLKVector2NS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE + 100007
13 HelloMap 0x000000010cbe361c _ZNSt3__16vectorI11_GLKVector2NS_9allocatorIS1_EEE26__swap_out_circular_bufferERNS_14__split_bufferIS1_RS3_EE + 90832
14 libdispatch.dylib 0x000000010fe90d9d _dispatch_call_block_and_release + 12
15 libdispatch.dylib 0x000000010feb13eb _dispatch_client_callout + 8
16 libdispatch.dylib 0x000000010fe9782c _dispatch_queue_drain + 2215
17 libdispatch.dylib 0x000000010fe96d4d _dispatch_queue_invoke + 601
18 libdispatch.dylib 0x000000010fe99996 _dispatch_root_queue_drain + 1420
19 libdispatch.dylib 0x000000010fe99405 _dispatch_worker_thread3 + 111
20 libsystem_pthread.dylib 0x00000001101ee746 _pthread_wqthread + 1299
21 libsystem_pthread.dylib 0x00000001101ee221 start_wqthread + 13
)
libc++ abi.dylib:以NSException类型的未捕获异常终止

最佳答案

感谢您报告此问题,这是由于我们使用HERE SDK中的Objective-C类别并将其作为静态库提供的。您可以做的一件事是将-ObjC链接器标志添加到您的内部版本(OTHER_LDFLAGS)中来解决此问题。

此处更多信息:Categories In Static Libraries

这将在将来的版本中修复。

关于ios - iOS/Swift::在初始化期间,HERE map 偶尔会崩溃=> [NSCFString hac_toVariant],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43733295/

相关文章:

c++ - COM 组件崩溃

ios - 为什么这个数组返回对象计数为 0?

ios - 是否有像在 android 中那样完成 UIviewcontroller 的功能?

ios - IOS 如何管理后台应用程序的内存?

ios - 如何为 MIDI 事件准确设置时间戳?

swift - 如何遍历所有 Mac 桌面空间

android - 同一 Activity 上有多个按钮

ios - 如何在 UIButton 的标签 subview 上设置 alpha

ios - 文本换行不适用于 "SCNText"节点

ios - Xamarin iOS 还原 PlaceHolder