Cordova iOS 3.9.2 crashes when installing update
I'm experiencing a crash in my Cordova 3.9.2 iOS app that occurs once CodePush has downloaded an update and then tries to install it. I'm running it on iOS 9.2.1.
This is the output from the Xcode console:
[CodePush] Package download success: ...
[CodePush] Installing update package ...
THREAD WARNING: ['File'] took '1799.862305' ms. Plugin should use a background thread.
[CodePush] First update: back up package information skipped.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[4]'
*** First throw call stack:
(0x1817ed900 0x180e5bf80 0x1816d6bcc 0x1816e2674 0x10008fb70 0x10008e6e4 0x1001413d8 0x100140ca4 0x100142260 0x1821afe20 0x1817a4efc 0x1817a4990 0x1817a2690 0x1816d1680 0x182be0088 0x186548d90 0x10004b3fc 0x1812728b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
This is the output from cordova plugin ls:
code-push 1.7.0-beta "CodePushAcquisition"
cordova-plugin-camera 1.2.0 "Camera"
cordova-plugin-code-push 1.5.1-beta "CodePush"
cordova-plugin-console 1.0.0 "Console"
cordova-plugin-crosswalk-webview 1.2.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.0.0 "Device"
cordova-plugin-dialogs 1.2.0 "Notification"
cordova-plugin-email 1.0.0 "EmailComposer"
cordova-plugin-file 2.0.0 "File"
cordova-plugin-file-transfer 1.0.0 "File Transfer"
cordova-plugin-geolocation 1.0.0 "Geolocation"
cordova-plugin-globalization 1.0.1 "Globalization"
cordova-plugin-inappbrowser 1.0.0 "InAppBrowser"
cordova-plugin-network-information 1.0.1 "Network Information"
cordova-plugin-splashscreen 3.0.0 "Splashscreen"
cordova-plugin-urlhandler 0.7.0 "URLHandler"
cordova-plugin-whitelist 1.0.0 "Whitelist"
cordova-plugin-x-socialsharing 5.0.7 "SocialSharing"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
phonegap-facebook-plugin 0.12.0 "Facebook Connect"
phonegap-plugin-barcodescanner 4.0.2 "BarcodeScanner"
phonegap-plugin-push 1.3.0 "PushPlugin"
The other non-standard Cordova change that I've made is to AppDelegate.m to fix some Facebook Connect plugin issues, I'm not sure if this could contribute to the crash though:
- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation
{
if (!url) {
return NO;
}
// iOS9 - https://github.com/ccsoft/cordova-facebook
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
sourceApplication, @"sourceApplication", nil];
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url userInfo:dict]];
return YES;
}
edit: It seems to work fine on the Android version of the app with Cordova 4.1.1.
Any ideas what could be causing this crash?
@mablack This is a new issue for us, so thanks for reporting it! The trail of logs and the error message you posted would almost seem to indicate that the config.xml file that gets bundled into your app doesn't include a <content src> attribute. Is that at all possible? We've seen other cases where 3rd party plugins unknowingly modify the config.xml file, which can cause interop issues for us.
We can try to repro this in the morning with the exact set of plugins you have installed to see if one of them is doing something here that is screwing up the assumptions that the CodePush plugin makes. Most of these plugins are ones we've verified co-exist just fine with CodePush, so we should hopefully be able to test out the remaining few.
@lostintangent yep, that seems to have been the problem!
The app was originally based on PhoneGap 3.3.0, and it looks like the <content src> attribute wasn't added to the original config.xml, so it's never been in there.
Thanks for your help!
Anytime! Let us know if you run into any other problems :)