[__NSDictionaryM cordovaSettingForKey:]:无法识别的选择器已发送到实例

时间:2018-12-09 03:08:17

标签: ios cordova

我对XCODE完全陌生,收到了此错误消息。你能帮我解决吗?

Screenshot

  

2018-12-08 21:46:22.258801-0500 IAOGI英语App [653:6168]   DiskCookieStorage将策略从2更改为0,Cookie文件:   文件:/// 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英语App [653:6168] Apache   Cordova本机平台版本4.5.5已启动。

     

2018-12-08 21:46:23.177968-0500 IAOGI英语App [653:6168]   多任务->设备:是,应用:是

     

2018-12-08 21:46:23.210797-0500 IAOGI英语App [653:6168]   -[__ NSDictionaryM cordovaSettingForKey:]:无法识别的选择器已发送到实例0x60000040df20

     

2018-12-08 21:46:23.277812-0500 IAOGI英语App [653:6168] ***   由于未捕获的异常而终止应用程序   'NSInvalidArgumentException',原因:'-[__ NSDictionaryM   cordovaSettingForKey:]:无法识别的选择器已发送到实例   0x60000040df20'

     

***第一次抛出调用堆栈:(0 CoreFoundation 0x000000010d54b1bb __exceptionPreprocess + 331

     

1 libobjc.A.dylib 0x000000010cabb735   objc_exception_throw + 48

     

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

     

3 CoreFoundation 0x000000010d54fed6    转发 + 1446

     

4 CoreFoundation 0x000000010d551da8   _CF_forwarding_prep_0 + 120

     

5 IAOGI英语应用0x000000010a9cacc7   -[CDVViewController viewDidLoad] + 199

     

6 IAOGI英语应用0x000000010a955df6   -[MainViewController viewDidLoad] + 54

     

7个UIKitCore 0x000000011acc14e1   -[UIViewController loadViewIfRequired] + 1186

     

8个UIKitCore 0x000000011acc1940   -[UIViewController视图] + 27

     

9 UIKitCore 0x000000011b318c53-[UIWindow   addRootViewControllerViewIfPossible] + 122

     

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

     

11 UIKitCore 0x000000011b32c5c0-[UIWindow   makeKeyAndVisible] + 42

     

12个IAOGI英语应用0x000000010a9cf4d0   -[CDVAppDelegate应用程序:didFinishLaunchingWithOptions:] + 752

     

13 IAOGI英语应用0x000000010a955b73   -[AppDelegate应用程序: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场景:didUpdateWithDiff:transitionContext:完成:] + 392

     

27 UIKitCore 0x000000011b2dd44e   -[UIApplication工作区:didCreateScene:withTransitionContext:完成:] + 515

     

28 UIKitCore 0x000000011ae81d09   -[UIApplicationSceneClientAgent场景:didInitializeWithEvent:完成:] + 357

     

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

     

30个FrontBoardServices 0x0000000116c28443   __56- [FBSWorkspace客户端: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英文应用0x000000010a955a91 main + 65

     

44 libdyld.dylib 0x000000010f942575 start + 1

     

45 ??? 0x0000000000000001 0x0 +1)   libc ++ abi.dylib:以类型未捕获的异常终止   NSException(lldb)

1 个答案:

答案 0 :(得分:1)

此错误表示未加载CordovaPreferences category。这表明这是静态链接,但是-objc标志没有传递给链接器。参见QA1490: Building Objective-C static libraries with categories。我对Cordova的构建系统不熟悉,但这表明您可能已经绕过它,或者项目设置已损坏。 (我一生中从未接触过Cordova,除了其说明指示有一些特殊的构建步骤外,我对它的构建方式一无所知。)

此堆栈的重要部分是此框架:

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

这是通用断言逻辑之前的最后一帧。在GitHub中搜索“ CDVViewController”会将我们带到CDVViewController.m。其-viewDidLoad包括:

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

查找settings表示它是NSMutableDictionary

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

由于cordovaSettingForKey:并不是NSMutableDictionary上的标准方法,因此很可能是类别方法,我们可以在源代码中多花点功夫找到它。该文件遵循标准命名模式:NSDictionary+CordovaPreferences.h(用+分隔的类和类别名称)。