I have a meteor app (BrewsOnTap) that works just fine when deployed as a website, but when testing on an Android device through cordova it gets stuck at the loading screen forever.

I don't see any relevant console errors or warnings. If I go to the IP that I'm serving the app from it even displays fine. The app is using iron-router and waitOn to display the loading template until the intial data is loaded... but apparently that isn't happening.
Suggestions for what the problem could be or next steps to debug it?
This looks very much like a connectivity problem. First thing to try in the console:
Router.current().ready()
If this doesn't return false then there is something very funny going on with Tracker or Iron-Router, as it (reactively) gives the master wait-list readiness, so if it returns true then there is something else preventing the page from rendering.
The best way to find out which item(s) in the wait-list isn't ready is to go through your Router code, pull out the subscription handles into a global object, and pass references to the waitOn callback.
For example, rather than:
waitOn: function() {
return [Meteor.subscribe('someThings'), Meteor.subscribe('someOtherThings')];
}
do this instead:
Subs = {};
waitOn: function() {
Subs.someThings = Meteor.subscribe('someThings');
Subs.someOtherThings = Meteor.subscribe('someOtherThings');
return [Subs.someThings, Subs.someOtherThings];
}
That way, you can run Subs.someThings.ready() from the console on each of the subscriptions to find out which it is that is preventing your page from rendering. Hopefully, this is a start.
However, whilst I don't fully understand the error messages you've posted, the fact that it's got "FAILED TO LOAD RESOURCE" strongly suggests a connection issue, which would prevent subscription data making its way to your client via DDP and thus prevent the subscription returning ready. I would have a look in the Network tab to see what's going on (or not doing) there.
Apologies that this isn't a solution, but hopefully it's a start. If it is connectivity, check all the things in here - i.e. Developer tools enabled, USB debugging allowed, Android device connected to the same wifi, IP correct...
UPDATE: Thinking about this a little more, the app is installed via USB debugging, so the fact that you can run it at all indicates that there isn't a problem there. However, I assume the data is passed over the local network, which is where the problem is, so I think it must be that the two devices are not connected to the same wifi, or else the supplied IP is incorrect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With