iOS Cordova应用程序在启动时因NSInvalidArgumentException而崩溃

时间:2016-06-20 11:14:06

标签: ios cordova cordova-plugins

我们在启动cordova应用时遇到了一个奇怪的错误

Apache Cordova native platform version 4.1.1 is starting.

[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x7fef81d10e00

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x7fef81d10e00'

*** First throw call stack:

(

0   CoreFoundation                      0x0000000105fdcd85 __exceptionPreprocess + 165

1   libobjc.A.dylib                     0x0000000105a50deb objc_exception_throw + 48

2   CoreFoundation                      0x0000000105fe5d3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205

3   CoreFoundation                      0x0000000105f2bcfa ___forwarding___ + 970

4   CoreFoundation                      0x0000000105f2b8a8 _CF_forwarding_prep_0 + 120

5   שוליק.נט                     0x0000000105527ab3 -[CDVViewController viewDidLoad] + 195

6   שוליק.נט                     0x0000000105525a06 -[MainViewController viewDidLoad] + 54

7   UIKit                               0x0000000106bf5984 -[UIViewController loadViewIfRequired] + 1198

8   UIKit                               0x0000000106bf5cd3 -[UIViewController view] + 27

9   UIKit                               0x0000000106acbfb4 -[UIWindow addRootViewControllerViewIfPossible] + 61

10  UIKit                               0x0000000106acc69d -[UIWindow _setHidden:forced:] + 282

11  UIKit                               0x0000000106ade180 -[UIWindow makeKeyAndVisible] + 42

12  שוליק.נט                     0x000000010552b188 -[CDVAppDelegate application:didFinishLaunchingWithOptions:] + 776

1 个答案:

答案 0 :(得分:0)

最近我遇到了与Visual Studio TACO项目相同的问题。特别是在将Cordova CLI平台版本从5.1.1更新到6.1.1时出现了这种情况。这导致iOS Cordova的原生版本从3.8.2修改为4.1.1,这引起了问题的评论。

经过多次测试后,我找到了解决方案。该问题是由位于'build.xconfig'的文件'[project_folder]/res/native/ios/cordova'引起的。删除此文件并重新编译项目后,问题就解决了。

enter image description here