Thanks ! I was stuck with the same problem, now everything work fine.
I think there no big conscequence about uncomment cordova, I see a line in the console about that : Ionic Core: cordova.js has already been loaded
I had more or less the same problem but in my case the issue was intermittent and not reproducible. See:
I also saw the warning about “cordova already loaded” (logged by the ionic.io libraries).
For now I just took out the ionic.io libraries (analytics etc, at the moment these are in “alpha” stage so probably it wouldn’t be wise to use them for production apps anyway). I’ll monitor closely if I see the issue again.
Do Not Remove Cordova, You may face some serious problem in future when you want to use some native library.
I made some tricks which solved this issue for me.
Create firebase instance just after app module like this -
var appMain = angular.module(‘starter’, [‘ngCordova’,‘ngStorage’,‘ionic’,‘starter.controllers’,‘starter.services’,‘firebase’]);
var firebaseInst = new Firebase(“https://xyz.firebaseio.com/”);
& this instance you can directly call in controller
var objMatches = $firebaseObject(firebaseInst.child(“methods”));
I was facing a similar problem on my android phone. Ironically my app ran smoothly on my development laptop and most of the time it ran smoothly on my android phone, but once this problem occurred my android, it kept loading without doing anything anymore, it never ran on my android again. Only when I did ‘ionic run android’ and reinstalled the app did it work again.
I had a look at my app resources via remote debugging and I noticed the key value: “firebase:previous_websocket_failure” had “true” to its value. So I deleted this key-value pair and simply restarted my app, then my app finally began working again. I plan on getting around this solution by checking for this key-value pair and removing it programatically, and hopefully the next time a user opens the app it will work…if the user hasn’t uninstalled it by then.
I dont know what happens to my app that this bug seems to crop up, so I cant replicate the conditions for the bug and know whether my code works. Normally that particular key value pair would get deleted once loading starts, but on some occasions it doesnt and thats why my app fails.
I dont know if this post helps. Just check your resources via remote debugging. Maybe its is something there. Let me know what you guys think.
I’ve also noticed this websocket failure in the localstorage, but usually disappears automatically… Next time our app keeps stuck during loading (it happens sometimes) I’ll check if it’s still there and remove it…
Exactly my point. In my case when app got stuck loading that key-value pair never dissappered as it should have so I’ve put it on $watch to delete it immediately if it turns up. Lets see if I run into this problem again. For the time being the app seems to work fine. Fingers crossed.
This issue has bugged me the most. I have found a potential solution for this problem now which fixed it for me.
1- Do not uncomment cordova.js
2 - wrap every firebase init with ionic paltform ready.
Firebase stays connected as long as the app is open in device.
THANK YOU!!! After upgrading to Cordova 6 and the latest cordova-ios, I started seeing this strange behavior. Wrapping my firebase calls up like this works great – I should have been doing that to begin with, I am guessing.