1

i'm currently facing an issue in two different projects using HEREMaps. Right after initializing via NMAApplicationContext.set(...) the app is crashing giving the following log:

2017-05-02 10:15:25.372 ANIO[3574:431630] -[NSCFString hac_toVariant]: unrecognized selector sent to instance 0x618000027560 2017-05-02 10:15:25.403 ANIO[3574:431630] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString hac_toVariant]: unrecognized selector sent to instance 0x618000027560' *** First throw call stack: ( 0 CoreFoundation 0x000000010edccb0b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010e41c141 objc_exception_throw + 48 2 CoreFoundation 0x000000010ee3c134 -[NSObject(NSObject) doesNotRecognizeSelector:] + 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: terminating with uncaught exception of type NSException

anyone facing the same problems? any idea? the only way to get rid of this error is de-/installing the app.

Kind regards,

Michael


OK, short update... the bug is easily reproducible.

1.)Download sample code from [link]https://developer.here.com/mobile-sdks/documentation/ios-starter/topics/quick-start.html

2.)Follow steps to include NMAKit-framework & NMAKit-bundle

3.)Build and run (Xcode Version 8.3.2 (8E2002)). Target simulator/hardware doesn't matter (tried iPhone 6/7/s simulator and hardware). Even using Obj-c or Swift sample makes no difference at all.

On first start everything's fine. Second start leads to crash.

2017-05-02 13:38:34.331 HelloMap[16821:1642096] -[NSCFString hac_toVariant]: unrecognized selector sent to instance 0x7f80266079a0 2017-05-02 13:38:34.342 HelloMap[16821:1642096] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString hac_toVariant]: unrecognized selector sent to instance 0x7f80266079a0' *** First throw call stack: ( 0 CoreFoundation 0x000000010d9d9d85 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010d44ddeb objc_exception_throw + 48 2 CoreFoundation 0x000000010d9e2d3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 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: terminating with uncaught exception of type NSException

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
iMike
  • 158
  • 4
  • Can you share code where you are facing this problem – Lalit kumar May 02 '17 at 08:29
  • @Lalitkumar: sure. it's just within the didFinishedLaunching-delegate, dirt simple... ```NMAApplicationContext.set(appId: kHelloMapAppID, appCode: kHelloMapAppCode)``` – iMike May 02 '17 at 09:05
  • let kHelloMapAppID:String = "6igOKA...." let kHelloMapAppCode:String = "3.......c9A". Even using the sample [link] https://developer.here.com/mobile-sdks/documentation/ios-starter/topics/app-simple-swift.html i'm running into the same results (sporadicly) – iMike May 02 '17 at 09:30
  • @Mike Please import NMAKit framework #define kHelloMapAppID @"" // and simple add these key as like in here premiums sdk #define kHelloMapAppCode @"" #define kHelloMapLicenseKey @"" – Lalit kumar May 02 '17 at 10:21
  • @Lalitkumar same behavio – iMike May 02 '17 at 10:30
  • @mike In NMkitframework find NMABundle.bundle and drag and drop in your app. – Lalit kumar May 02 '17 at 10:34
  • @Lalitkumar NMABundle.bundle is linked. same behavior. First launch after installation works well, second start ends up in [__NSCFString hac_toVariant]-exception. This drives me crazy. Maybe there's an issue concerning Swift-bridgings. It must have something to do with the NMAApplicationContext.set(). App is crashing as soon as i call it. – iMike May 02 '17 at 10:36
  • what's "hac_toVariant" doing exactly? there must be something "dirty coded" in it. – iMike May 02 '17 at 10:37
  • @imike if you did not find any solutions Question with tag hereapi. hope here developers will give the proper solution – Lalit kumar May 02 '17 at 10:40
  • @Lalitkumar thanks for your help so far. just tried the shipped sample (here maps). same results (xcode version 8.3.2 (8E2002)). testing in iPhone 7s sim. doesn't even work on real hardware:-) ... hope to hear from "here". – iMike May 02 '17 at 10:48

1 Answers1

0

Thanks for reporting this, this is caused by us using Objective-C Categories in the HERE SDK and shipping it as a static library. One thing you can do is add the -ObjC linker flag to your build (OTHER_LDFLAGS) to get around this.

More info here: Categories In Static Libraries

This will be fixed in a future release.

AndrewJC
  • 1,318
  • 12
  • 11