0
votes

I am totally new to XCODE, got this error message. Could you help me to solve it?

Screenshot

2018-12-08 21:46:22.258801-0500 IAOGI English App[653:6168] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/admin/Library/Developer/CoreSimulator/Devices/753BE612-F65B-44E8-A727-347043E8736A/data/Containers/Data/Application/8D1AD8A3-6384-48C0-8C1C-29F27E098D80/Library/Cookies/com.iaogcan.english.binarycookies

2018-12-08 21:46:23.175378-0500 IAOGI English App[653:6168] Apache Cordova native platform version 4.5.5 is starting.

2018-12-08 21:46:23.177968-0500 IAOGI English App[653:6168] Multi-tasking -> Device: YES, App: YES

2018-12-08 21:46:23.210797-0500 IAOGI English App[653:6168] -[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x60000040df20

2018-12-08 21:46:23.277812-0500 IAOGI English App[653:6168] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x60000040df20'

*** First throw call stack: ( 0 CoreFoundation 0x000000010d54b1bb __exceptionPreprocess + 331

1 libobjc.A.dylib 0x000000010cabb735 objc_exception_throw + 48

2 CoreFoundation 0x000000010d569f44 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132

3 CoreFoundation 0x000000010d54fed6 forwarding + 1446

4 CoreFoundation 0x000000010d551da8 _CF_forwarding_prep_0 + 120

5 IAOGI English App 0x000000010a9cacc7 -[CDVViewController viewDidLoad] + 199

6 IAOGI English App 0x000000010a955df6 -[MainViewController viewDidLoad] + 54

7 UIKitCore 0x000000011acc14e1 -[UIViewController loadViewIfRequired] + 1186

8 UIKitCore 0x000000011acc1940 -[UIViewController view] + 27

9 UIKitCore 0x000000011b318c53 -[UIWindow addRootViewControllerViewIfPossible] + 122

10 UIKitCore 0x000000011b31936e -[UIWindow _setHidden:forced:] + 294

11 UIKitCore 0x000000011b32c5c0 -[UIWindow makeKeyAndVisible] + 42

12 IAOGI English App 0x000000010a9cf4d0 -[CDVAppDelegate application:didFinishLaunchingWithOptions:] + 752

13 IAOGI English App 0x000000010a955b73 -[AppDelegate application:didFinishLaunchingWithOptions:] + 195

14 UIKitCore 0x000000011b2d7bde -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 280

15 UIKitCore 0x000000011b2d95cb -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3979

16 UIKitCore 0x000000011b2dec2f -[UIApplication _runWithMainScene:transitionContext:completion:] + 1623

17 UIKitCore 0x000000011aafd4e9 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866

18 UIKitCore 0x000000011ab0629c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153

19 UIKitCore 0x000000011aafd126 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233

20 UIKitCore 0x000000011aafdae0 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085

21 UIKitCore 0x000000011aafbcb5 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795

22 UIKitCore 0x000000011aafb95f -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435

23 UIKitCore 0x000000011ab00a90 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584

24 UIKitCore 0x000000011ab0180e _performActionsWithDelayForTransitionContext + 100

25 UIKitCore 0x000000011ab007ef -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221

26 UIKitCore 0x000000011ab0593a -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392

27 UIKitCore 0x000000011b2dd44e -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515

28 UIKitCore 0x000000011ae81d09 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357

29 FrontBoardServices 0x0000000116c1d2da -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448

30 FrontBoardServices 0x0000000116c28443 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271

31 FrontBoardServices 0x0000000116c27b3a __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53

32 libdispatch.dylib 0x000000010f8cc602 _dispatch_client_callout + 8

33 libdispatch.dylib 0x000000010f8cfb78 _dispatch_block_invoke_direct + 301

34 FrontBoardServices 0x0000000116c5cba8 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 30

35 FrontBoardServices 0x0000000116c5c860 -[FBSSerialQueue _performNext] + 457

36 FrontBoardServices 0x0000000116c5ce40 -[FBSSerialQueue _performNextFromRunLoopSource] + 45

37 CoreFoundation 0x000000010d4b0721 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17

38 CoreFoundation 0x000000010d4aff93 __CFRunLoopDoSources0 + 243

39 CoreFoundation 0x000000010d4aa63f __CFRunLoopRun + 1263

40 CoreFoundation 0x000000010d4a9e11 CFRunLoopRunSpecific + 625

41 GraphicsServices 0x00000001128761dd GSEventRunModal + 62

42 UIKitCore 0x000000011b2e081d UIApplicationMain + 140

43 IAOGI English App 0x000000010a955a91 main + 65

44 libdyld.dylib 0x000000010f942575 start + 1

45 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

1
Did you ever resolve this?user2943799

1 Answers

2
votes

This error indicates that the CordovaPreferences category isn't being loaded. That suggests this is being linked statically, but the -objc flag wasn't passed to the linker. See QA1490: Building Objective-C static libraries with categories. I'm not familiar with Cordova's build system, but this suggests you've perhaps bypassed it, or the project settings are corrupted. (I've never touched Cordova in my life, and I don't know anything about how it builds other than its instructions indicate there's some special build step.)

The important part of this stack is this frame:

5 IAOGI English App 0x000000010a9cacc7 -[CDVViewController viewDidLoad] + 199

This is the last frame preceding the generic assertion logic. Searching for "CDVViewController" in GitHub brings us to CDVViewController.m. Its -viewDidLoad includes:

id backupWebStorage = [self.settings cordovaSettingForKey:@"BackupWebStorage"];

Looking up settings shows it's an NSMutableDictionary:

@property (nonatomic, readwrite, strong) NSMutableDictionary* settings;

Since cordovaSettingForKey: isn't a standard method on NSMutableDictionary, it is very likely a category method, which we can find with a little more hunting in the source code. The file follows the standard naming pattern: NSDictionary+CordovaPreferences.h (a class and category name separated by a +).