iOS app freezes on load with Cordova 4.0.1 and latest ionic

I’m having the same Issue since updating both, Cordova and Ionic. In my case the app sometimes starts up normally, and sometimes the app gets stuck at the point where the .ready function should get fired. And it only occurs on IOS; Android works fine. As the app crashes before the .ready function it is not accessible through the Safari debugger. The output from XCode is:

2016-02-19 11:53:28.388 docbox[2036:434719] Apache Cordova native platform version 4.0.1 is starting. 2016-02-19 11:53:28.391 docbox[2036:434719] Multi-tasking -> Device: YES, App: YES 2016-02-19 11:53:28.536 docbox[2036:434719] Using UIWebView 2016-02-19 11:53:28.538 docbox[2036:434719] [CDVTimer][handleopenurl] 0.160992ms 2016-02-19 11:53:28.541 docbox[2036:434719] [CDVTimer][intentandnavigationfilter] 2.467036ms 2016-02-19 11:53:28.542 docbox[2036:434719] [CDVTimer][gesturehandler] 0.132024ms 2016-02-19 11:53:28.568 docbox[2036:434719] [CDVTimer][splashscreen] 26.578963ms 2016-02-19 11:53:28.587 docbox[2036:434719] [CDVTimer][statusbar] 18.814981ms 2016-02-19 11:53:28.588 docbox[2036:434719] [CDVTimer][keyboard] 0.425994ms 2016-02-19 11:53:28.614 docbox[2036:434719] [CDVTimer][file] 26.117980ms 2016-02-19 11:53:28.615 docbox[2036:434719] [CDVTimer][TotalPluginStartup] 76.453984ms 2016-02-19 11:53:28.624 docbox[2036:434719] active 2016-02-19 11:53:28.624 docbox[2036:434719] PushPlugin skip clear badge 2016-02-19 11:53:28.857 docbox[2036:434719] Resetting plugins due to page load. 2016-02-19 11:53:29.551 docbox[2036:434719] Finished load of: file:///var/mobile/Containers/Bundle/Application/5E519660-3AC3-445B-8E93-CD35F7D389E4/docbox.app/www/index.html#/tab/myServices

This is the exact same output I get when the app crashes and when the app loads normally. If it starts up the next output is from Ionic Analytics, which gets loaded in the .ready function.

Did someone get this working again, as an app like this is not releasable.

Hmm, this is still happening for me. It’s seemingly random, which makes me think there is a funky timing issue going on somewhere, a slight delay in loading a dependency or a plugin is stalling the device before it can fire .ready… any news elsewhere?

Check this issue:

https://issues.apache.org/jira/browse/CB-10530

1 Like

This seams to be the problem, thanks. I hope 4.1.0 is released soon.

It seems the fix got merged into cordova master (https://issues.apache.org/jira/browse/CB-10530?jql=labels%20%3D%20cordova-ios-4.1.0) anyone know how often cordova release? I don’t really want to pull master in my app thats ready for release… This bug has caused me so many issues.

Hi everyone. If anyone is still struggling with this issue please follow the steps listed here:

http://cordova.apache.org/announcements/2016/03/02/ios-4.1.0.html

The steps are as follows:

npm install -g cordova cd my_project cordova platform rm ios cordova platform add ios@4.1.0

This fixed the issue for me. Also this issue completely destroyed my development time for the last 2 weeks because I thought there was something wrong with my code the entire time. Probably the worst bug I’ve encountered in my life. :cry:

3 Likes

Hi I have the same problem, I update to 4.1.0 but I still get the splash screen and it freeze there.

2016-03-21 17:52:30.392 AdminApp[329:23683] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///private/var/mobile/Containers/Data/Application/027BC576-04F5-4A2F-A621-BD79C2B65679/Library/Cookies/Cookies.binarycookies
2016-03-21 17:52:30.524 AdminApp[329:23683] Apache Cordova native platform version 4.1.0 is starting.
2016-03-21 17:52:30.525 AdminApp[329:23683] Multi-tasking -> Device: YES, App: YES
2016-03-21 17:52:30.657 AdminApp[329:23683] Using UIWebView
2016-03-21 17:52:30.662 AdminApp[329:23683] [CDVTimer][handleopenurl] 0.162005ms
2016-03-21 17:52:30.664 AdminApp[329:23683] [CDVTimer][intentandnavigationfilter] 2.043009ms
2016-03-21 17:52:30.664 AdminApp[329:23683] [CDVTimer][gesturehandler] 0.128984ms
2016-03-21 17:52:30.693 AdminApp[329:23683] [CDVTimer][splashscreen] 28.393030ms
2016-03-21 17:52:30.721 AdminApp[329:23683] [CDVTimer][localstorage] 28.083980ms
2016-03-21 17:52:30.721 AdminApp[329:23683] [CDVTimer][TotalPluginStartup] 60.093999ms
2016-03-21 17:52:31.015 AdminApp[329:23683] Resetting plugins due to page load.
2016-03-21 17:52:31.616 AdminApp[329:23683] Finished load of: file:///var/mobile/Containers/Bundle/Application/15207E37-B6A6-43FC-B0C4-808EF423B7A7/AdminApp.app/www/index.html

I am using Cordova iOS 4.1.0 and am still experiencing the same problem - Ionic iOS app freezes.

I too have lost 5 days of work because of this insanity. I upgraded to ios@4.1.0 but the hang was still there and no errors in any console. It turns out that these may not be “hangs” at all; it’s just the splash screen not going away on its own under iOS (it does on other platforms).

Check this thread: Splash Screen Problem

In short, put some code that looks like this in your .run() method:

if (ionic.Platform.isIOS()){
setTimeout(function () {
navigator.splashscreen.hide();
}, 3000 - 1000);
}

2 Likes

@Atsats does this work?
if (ionic.Platform.isIOS()){
setTimeout(function () {
navigator.splashscreen.hide();
}, 3000 - 1000);
}

Yes, this worked for me but make sure you also update the Cordova iOS platform to 4.1.0 (this is separate from the Cordova CLI version) as there was a separate issue that caused hangs in iOS with prior versions.

@Atsats : okay, I am a still trying to figure out how to update cordova ios platform, can you point me to some reference may be?

I feel your pain, having gone through all of this recently. It’s very easy, here’s a link with simple commands that will help:
Cordova iOS 4.1.0 Blog

@Atsats : thanks for the link, however, correct me if I am wrong

// upgrades cordova cli
npm install -g cordova

cd my_project

cordova platform rm ios

// Adds cordova ios platform, should not this be ionic platform add ios?
cordova platform add ios@4.1.0

Sorry, yes, if you’re using ionic, then use

ionic platform add ios@4.1.0

Well, thanx a lot, after 3 days scratching my head i found this thread and you saved me. I thought i was gonna become crazy over this.

It’s all working now with the function

if (ionic.Platform.isIOS()){
setTimeout(function () {
navigator.splashscreen.hide();
}, 3000 - 1000);
}

I was able to fix the issue with upgrading my Cordova iOS from 4.0.1 to 4.1.0 and adding the snippet:

if (ionic.Platform.isIOS()){ setTimeout(function () { navigator.splashscreen.hide(); }, 3000 - 1000); }

This works for simulator with or without livereload (-l) option. However, it only works on real device without livereload, which means if I run:

ionic run ios --device -l

it still freezes at splash screen.

Does anyone have the same issue here?

1 Like

Thanku @ishanshethstl … Solve the bug by adding ios@4.1.0

i upgrated cordova platform update ios@4.1.0 for installing phonegap-plugin-push plugin but after installing i am not getting device UUid and device Platform from device.uuid and device.platform for ios but i got these value for android platform and i have already installed cordova plugin add cordova-plugin-device.
$ionicPlatform.ready(function() {
console.log(‘deviceready’);
});
$ionicPlatform.ready fired only for android. not for ios

Thank you @Atsats… it works… saves my day… :slight_smile: