iOS app freezes on load with Cordova 4.0.1 and latest ionic

I have no idea what is going on but my app is freezing on load and the $ionicPlatform.ready is not firing at all…

<!-- compiled css output -->
    <link href="css/" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.js"></script>
    <script src="lib/ionic-platform-web-client/dist/"></script>
    <script src="lib/ionic/js/angular/angular-sanitize.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <!-- Cordova is bootstrapped by ionic-platform-web-client, uncomment this if you remove ionic-platform-web-client... -->
<!-- <script src="cordova.js"></script> -->

    <!-- your app's js -->
    <script src="js/app.js"></script>
    <script src="js/ng-cordova.min.js"></script>
    <script src="js/purchase.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/services.js"></script>
    <script src="js/factories.js"></script>
    <script src="js/directives.js"></script>
    <script src="js/routes.js"></script>
    <script src="js/ion-audio.js"></script>

And in app.js

angular.module('app', ['ionic','ionic.service.core', '', 'app.controllers', 'app.routes', '', 'app.directives', 'ionic-audio', 'ngSanitize'])

.run(function($ionicPlatform, $localstorage, $state, $timeout, $ionicAnalytics) {
     $ionicPlatform.ready(function() {
              console.log('app is running...');  //DOES NOT LOG IN CONSOLE APP HANGS

Seemingly after upgrade and installing the platform-web-client everything has gone wrong and the app doesn’t load. What am I missing?

1 Like

Had a similar experience last week. The app worked fine with ionic serve, but both in the emulator and on the actual device it froze.

In my case this was due to a service trying to access something that was initialised in the .ready function. Since the service loaded before the .ready function fires, it accessed an object which wasn’t initialised and everything froze. Maybe something similar is happening in your project.

Sometimes I also notice things get unstable for no apparent reason. If I really can’t find what’s wrong, I usually uninstall and reinstall the iOS platform.

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/

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:

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 ( 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:

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:


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/

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 () {
}, 3000 - 1000);


@Atsats does this work?
if (ionic.Platform.isIOS()){
setTimeout(function () {
}, 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 () {
}, 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