Phonegap crashing suddenly second time loaded on iphone

So I had an issue today with Phonegap using phoengap build where the app loads okay the first time, but the second time you load it runs fine and then after about 5 seconds it crashed with no warnings.

Using phonegap build this was a massive problem as I really struggled to debug it. However, using Apples iPhone Configuration Utility which handily is available on Windows and Mac I could get a snippet of the error going down:


<p class="p1">Sep  4 13:54:14 Haydens-iPhone AppName[529] &lt;Warning&gt;: THREAD WARNING: ['org.apache.cordova.facebook.Connect'] took '65.408936' ms. Plugin should use a background thread.
<p class="p1">Sep  4 13:54:14 Haydens-iPhone AppName[529] &lt;Warning&gt;: THREAD WARNING: ['InAppPurchase'] took '33.147217' ms. Plugin should use a background thread.
<p class="p1">Sep  4 13:54:15 Haydens-iPhone AppName[529] &lt;Warning&gt;: THREAD WARNING: ['Geolocation'] took '31.754883' ms. Plugin should use a background thread.
<p class="p1">Sep  4 13:54:15 Haydens-iPhone AppName[529] &lt;Warning&gt;: InAppPurchase[objc]: Getting products data
<p class="p1">Sep  4 13:54:15 Haydens-iPhone AppName[529] &lt;Warning&gt;: InAppPurchase[objc]: Set has 2 elements
<p class="p1">Sep  4 13:54:15 Haydens-iPhone AppName[529] &lt;Warning&gt;: InAppPurchase[objc]:  - newpet002
<p class="p1">Sep  4 13:54:15 Haydens-iPhone AppName[529] &lt;Warning&gt;: InAppPurchase[objc]:  - instantpet001
<p class="p1">Sep  4 13:54:15 Haydens-iPhone AppName[529] &lt;Warning&gt;: InAppPurchase[objc]: Starting product request...
<p class="p1">Sep  4 13:54:15 Haydens-iPhone AppName[529] &lt;Warning&gt;: InAppPurchase[objc]: Product request started
<p class="p2">
<p class="p1">Sep  4 13:54:15 Haydens-iPhone AppName[529] &lt;Error&gt;: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSRegularExpression enumerateMatchesInString:options:range:usingBlock:]: nil argument'
<p class="p1">*** First throw call stack:
<p class="p1">(0x2e8aaf83 0x39125ccf 0x2e8aaec5 0x2f22522b 0x2f225115 0x9067b 0x906ff 0x9406d 0xb9f49 0xb91af 0xb71f7 0xbb6e7 0xbb621 0xbbc5b 0x2f1eafc3 0x2f1eaf07 0x2f1eae21 0x2e5110e7 0x2e50fcf7 0x2e7de8f1 0x2e4a76bb 0x2e4a7579 0x2e4a740d 0x2e87620b 0x2e8756db 0x2e873ecf 0x2e7deebf 0x2e7deca3 0x33738663 0x3112b14d 0x9323f 0x39632ab7)
<p class="p1">

Which I thought would at least help me…It really didn’t.

Not to worry, we fight on. After getting rid of the plugins one by one I found out I had an issue with the Facebook Connect plugin. But this was odd as it had been working fine.

After too many hours of faffing around I remembered I recently let phonegap build talk me in to using 3.5.0 of phonegap. A quick revert back to 3.4.0 and the problem was resolved.

So there you have it, the latest isn’t always the greatest.

Tom

Like this Article? Share it!

About the Author

Author Gravatar
Tom

Tom's a developer who has a love of all things technical. 7TB For the fileserver just isn't enough for him these days. You can usually find him buying things he doesn't need or watching Reading FC.

Related Posts

Leave a Comment