Cordova iOS app and OS reboot on first-time install

It had all the elements of a Mr.Monk episode, barring the killing, of course!

There was this cordova android app, which we had "ported" to iOS, for a customer.  cordova build went off fine, we could sign the app with adhoc provisioning profile and the app launched fine on iPhone.

Now, cordova apps are universal (they typically run on all devices).  On our iPad mini, we saw a strange thing - the app installed fine (from Testflight).  We clicked on the app icon and then we saw a blank screen followed by the apple logo - indicating an OS restart.

What could be wrong?  For good measure, we tried on another iPad - and saw the same result - the first time clicking of app icon resulted in a reboot of iPad.

What about subsequent times?  The app worked with no errors.

No other problems with the app either.

What was special about iPads vs iPhones?  We couldn't figure out anything.

We tried the same from the simulator (for iPad). The app worked fine.  Strange, indeed!

So, we connected the device to the Mac and tried to debug the issue.   We saw some Errors/Warnings/Notice in the log - but nothing that indicated what caused the reboot...

Parent[339]  : DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/BA77CF31-E7BC-4E48-8B5E-5CEC7464CD37/Library/Cookies/Cookies.binarycookies
...
Unknown[339] 
...
SpringBoard[316] : Received memory warning.
...
backboardd[318] : System app "com.apple.springboard" has died. Waiting for it to spawn again...
...
Parent[339] : Terminating since there is no system app.
...
backboardd[318] : PUIProgressWindow not using PreBoard appearance
...
MobileMail[321] : Terminating since there is no system app.
...
ReportCrash[341] : task_set_exception_ports(B07, 400, D03, 0, 0) failed with error (4: (os/kern) invalid argument)

We tried many things
  • regenerated the cordova app
  • updated the version of cordova
  • tried with different versions (iOS 7 vs iOS 8)
  • removed some native code that we thought could be causing this
No luck!

And then we saw something. While we were changing the version and regenerating, we tested with a version that had default cordova images. This app installed without a reboot/crash.

Ah, perhaps there is something wrong with the app icons or the splashscreen images?  We had replaced the default ones with the ones provided the customer.

We looked at the image properties and were in for a shock!

Each image had a resolution which was way higher than the expected resolution.  The default images

of cordova app had no such issues.

We resized all the images to the required resolution and that was it!  No more crash!

Who would have thought, having app icons or splashscreens which  had resolutions more than required could cause the OS to reboot (and that too only the first time)!


So a simple thumb rule.  Verify that the icons and screenshots match the expected resolutions.  Or spend time troubleshooting strange issues!

Comments

  1. Hello. I'm getting the same error: DiskCookieStorage changing policy from 2 to 0, cookie file.

    Could you post the image resolutions that fixed your problem? My app seems to work for all but creating account. Originally, the loading screen was there indefinitely so I pragmatically closed it in my code which seemed to fix the problem. But after reading your problem, I guess I just cleared a symptom of the problem. Thanks in advance

    ReplyDelete
  2. THIS BLOGGING SOFTWARE IS THE WORST i'VE EVER SEEN. I've trying to scroll the page, but the annoying pop-out keeps showing up. And to make matters worse, there is NO way to get rid of. In addition, if I click on the wrong place on the page it flips to a new page.

    How did you ever find such a badly designed, poorly though-out piece of software.

    ReplyDelete

Post a Comment

Popular posts from this blog

Opening a safe deposit locker in SBI

Opening a Kannada Word document

Automating a cordova ios build