'meteor run android-device': Meteor.Status() stuck on "waiting" after "connecting"

I’m trying to run a simple web app on a phone for the first time (Samsung Galaxy Prevail).

My meteor server is my dev desktop, Ubuntu 14.04.

I’ve tried every imaginable permutation of every comment of every StackOverflow thread I could find. Most recently I’m trying this:

meteor run android-device --mobile-server http://192.168.0.100:3000 -v

My phone is connected to my router’s wifi. My desktop is connected to the same router (though through ethernet cable–is this ok?).

I see the app run, my home page (Just Bootstrap 3 with a login and minimal navbar). I can login, apparently, but as soon as I click a link to the main functional part of the app, I’m stuck on “connecting” which eventually turns into “waiting”, forever.

The only thing I notice from the verbose output is the following (let me know if you need to see more):

    I20150507-04:52:41.373(-7) (android:meteor_cordova_loader.js:12) METEOR CORDOVA DEBUG (meteor_cordova_loader.js) Error reading version file Error: Failed to resolve entry: file:///data/data/com.idbzpo1upqh87wp5no3r/files/meteor/version
I20150507-04:52:41.375(-7) (android:meteor_cordova_loader.js:12) METEOR CORDOVA DEBUG (meteor_cordova_loader.js) Couldn't load from the manifest, falling back to the bundled assets.
I20150507-04:52:41.444(-7) (android:meteor_cordova_loader.js:12) METEOR CORDOVA DEBUG (meteor_cordova_loader.js) Loading from url: http://meteor.local
I20150507-04:52:44.037(-7) (android:http://meteor.local/packages/autoupdate.js:341) METEOR CORDOVA DEBUG (autoupdate_cordova.js) cordova.file.dataDirectory is null, retrying in 20ms

Only after I’ve written this whole post do I see a similar thread, but it’s not clear that my situation is exactly the same (Ubuntu, running local server, etc.) Here’s the thread I refer to: Deploying server for Meteor Cordova App

Thanks for any suggestions on how to make progress as I’m dead in the water here.
Chris

Hi Chris

Maybe just try:

meteor run android-device

with your phone plugged into your dev pc.

Works for me.

Oh, and in my mobile-config.js file in my project root folder, (create it if you need to) I’ve added this line:
App.accessRule("*");
if it helps.

Then restart your project.

meteor run android-device

with no other parameters

Thanks for your reply.

“meteor run android-device” was the very first thing I tried.

Yesterday I read a blog that suggested adding the App.accessRule() line, with the IP and port of the meteor server. I tried that and I tried your wildcard way, no changes.

BTW, are you having success with Android connecting to a meteor server on Linux? Ubuntu? Did you have to do anything with the firewall? anything with router port-forwarding?

I run “sudo ufw status” and get “ERROR: problem running ip6tables”. I’ve read all the things google-able from that, to no avail. I did do “sudo service ufw stop” which appears to stop ufw, but the underlying iptables rules are still in place. I’m not clear on what (or if) I need to change there. “sudo iptables -F” kills all the rules and even kills Internet.

Hi guys,

I have this error too. I have been browsing around for solutions.
Using app accessrule has indeed helped me
either
App.accessRule("")
or
App.accessRule("http:///
")

Let me know if you have solved this problem otherwise

I had it working a couple weeks ago. I haven’t done anything that I could imagine being relevant since then (I only can work on the app occasionally right now). I added the ryw blog. I fixed a bug or two, but nothing involving the server, the DDP connection, anything like that. I am back to being stuck on this again.

It’s not working for me anymore

1 Like

I noticed something very strange by accident this morning.

I had been experimenting with different ports and firewall settings (kind of trying everything by now), and at one point I got excited because I saw “connected”. But I could not log in.

Turns out something very strange happened. I had chosen a port where I had another mup-deployed app, one from a hackathon that was really nothing much more than an API point for an iOS app.

So the app I’m really caring about launched, and Meteor.status() reported “connected”, but in some way it was “connected” to a different Meteor app/database.

That seems to me to rule out connection issues, Android issues, Ubuntu issues, server issues, and suggests something to do with my packages or code.

As for my code, it runs well as a web app, which is where I’ve spent 95% of my development time. As for packages, here they are:

    accolver:twilio-meteor        1.10.1  Twilio API Wrapper for Meteor
accounts-password             1.1.1  Password support for accounts
ajbarry:yahoo-finance         0.1.4_1  Yahoo Finance Stock Quote Data Utility for Meteor Se...
alanning:roles                1.2.13  Role-based authorization
browser-policy                1.0.4  Configure security policies enforced by the browser
dburles:collection-helpers    1.0.3  Transform your collections with helpers that you define
email                         1.0.6  Send email messages
hitchcott:app-dump            0.1.3  In-app Backup and Restore for your Mongo Database
houston:admin                 2.0.3  A zero-config Meteor Admin
http                          1.1.0  Make HTTP calls to remote servers
ian:accounts-ui-bootstrap-3   1.2.61  Bootstrap-styled accounts-ui with multi-language supp...
iron:router                   1.0.9  Routing specifically designed for Meteor
lepozepo:accounting           1.0.0  Accounting.js -  number, money and currency formatting...
less                          1.0.14  The dynamic stylesheet language
meloncon:footable             0.0.5  Responsive HTML Table for Meteor
meteorhacks:kadira            2.22.0  Performance Monitoring for Meteor
meteorhacks:ssr               2.1.2  Server Side Rendering for Meteor with Blaze
mizzao:bootstrap-3            3.3.1_1  HTML, CSS, and JS framework for developing responsiv...
momentjs:moment               2.10.3  Moment.js (official): parse, validate, manipulate, an...
mrt:x-editable-bootstrap3     1.5.2  X-Editable 1.5.0 for Bootstrap3 with wysihtml5 rich te...
msavin:jetsetter              1.0.17  Visual Get/Set Tool for Sessions
msavin:mongol                 1.0.97  The insanely handy development package for Meteor.
percolate:synced-cron         1.2.1  Allows you to define and run scheduled jobs across mul...
prasad19sara:client-debugger  0.2.1  Facilitates to debug client side codes of meteor apps. 
standard-app-packages         1.0.5  Moved to meteor-platform
underscore                    1.0.3  Collection of small helpers: _.map, _.each, ...

For comparison, the hackathon app thing that I apparently accidentally “connected” to, it was using these packages:

accounts-password             1.1.1  Password support for accounts
dburles:google-maps           1.0.9* Google Maps Javascript API v3
digilord:sugarjs              1.4.1  Sugar is a Javascript library that extends native obje...
facts                         1.0.4  Publish internal app statistics
fuatsengul:leaflet            1.0.1  leaflet 0.7.3
houston:admin                 2.0.3  A zero-config Meteor Admin
http                          1.1.0  Make HTTP calls to remote servers
iron:router                   1.0.7* Routing specifically designed for Meteor
meteor-platform               1.2.2  Include a standard set of Meteor packages in your app
miktam:loggly                 1.0.0  Loggly for Meteor
mizzao:bootstrap-3            3.3.1_1  HTML, CSS, and JS framework for developing responsiv...
momentjs:moment               2.10.3  Moment.js (official): parse, validate, manipulate, an...
mrt:accounts-ui-bootstrap-3   0.3.3  Bootstrap styled version of login widgets
msavin:mongol                 1.0.30* The insanely handy development package for Meteor.
prasad19sara:client-debugger  0.2.1  Facilitates to debug client side codes of meteor apps. 
underscore                    1.0.3  Collection of small helpers: _.map, _.each, ...

Naturally I immediately tried stopping this hackathon app, restart my phone, re-mup-deploy, re run android-device… and I’m still stuck at the same place “connecting” / “waiting”.

I’m still having my morning coffee and need to mull this over, but does this give anybody any clues or does anybody have any suggestions where to proceed with debugging this?

one more thing. When my app did launch and reported “connected” (apparently to my hackathon app in some way), this is the --verbose output:

Installing app on device...
Launching application...
LAUNCH SUCCESS
Command finished with error code 0: /home/mylinuxuser/www/dev/m.myapp.com/app/.meteor/local/cordova-build/platforms/android/cordova/run --device
I20150619-06:43:29.797(-7) (android:meteor_cordova_loader.js:12) METEOR CORDOVA DEBUG (meteor_cordova_loader.js) Error reading version file Error: Failed to resolve entry: file:///data/data/com.idbzpo1upqh87wp5no3r/files/meteor/version
I20150619-06:43:29.799(-7) (android:meteor_cordova_loader.js:12) METEOR CORDOVA DEBUG (meteor_cordova_loader.js) Couldn't load from the manifest, falling back to the bundled assets.
I20150619-06:43:29.878(-7) (android:meteor_cordova_loader.js:12) METEOR CORDOVA DEBUG (meteor_cordova_loader.js) Loading from url: http://meteor.local
I20150619-06:43:33.261(-7) (android:http://meteor.local/:0) XMLHttpRequest cannot load http://m.staging.myapp.com/__cordova/manifest.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://meteor.local' is therefore not allowed access.
I20150619-06:43:33.265(-7) (android:http://meteor.local/packages/autoupdate.js:44) METEOR CORDOVA DEBUG (autoupdate_cordova.js) Failed to download the manifest network undefined

At last I was able to connect to my server. I know by now I really should create a blog or something on everything I went through and perhaps I’ll get to that, but for now I have it working.

I’ll need to collect all my notes and things, because there were all kinds of gotchas, but probably the biggest piece for at least that final origin policy problem I mentioned above seems to have been helped especially by Slava Kim’s post about the browser-policy package which indeed I had to make use of: https://github.com/meteor/meteor/issues/4132

Same problem here. This seems to be kind of random. Very annoying :frowning:

Had the same problem with another app. Problem here was the force-ssl package (had to be removed).