{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/4855","labels_url":"https://api.github.com/repos/meteor/meteor/issues/4855/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/4855/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/4855/events","html_url":"https://github.com/meteor/meteor/issues/4855","id":98498183,"number":4855,"title":"Mobile App Hot Code push problem","user":{"login":"cachrisman","id":6521666,"avatar_url":"https://avatars.githubusercontent.com/u/6521666?v=3","gravatar_id":"","url":"https://api.github.com/users/cachrisman","html_url":"https://github.com/cachrisman","followers_url":"https://api.github.com/users/cachrisman/followers","following_url":"https://api.github.com/users/cachrisman/following{/other_user}","gists_url":"https://api.github.com/users/cachrisman/gists{/gist_id}","starred_url":"https://api.github.com/users/cachrisman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cachrisman/subscriptions","organizations_url":"https://api.github.com/users/cachrisman/orgs","repos_url":"https://api.github.com/users/cachrisman/repos","events_url":"https://api.github.com/users/cachrisman/events{/privacy}","received_events_url":"https://api.github.com/users/cachrisman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-01T01:55:14Z","updated_at":"2015-08-01T22:45:07Z","closed_at":"2015-08-01T22:45:07Z","body":"I followed the simple todo app with angular tutorial to make an example meteor app.\r\n\r\nI then deployed to server with `mupx deploy`\r\n\r\nI can use web browser on computer or phone to visit and it works fine (although mobile doesn't look all that nice)\r\n\r\nthen to build and sign the android app, I do \r\n````\r\nbuild ../mobile_build --server=http://[serverhostname.com]\r\ncd ../mobile_build/android\r\njarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 unaligned.apk simple-todo\r\nzipalign 4 unaligned.apk production.apk\r\nadb install production.apk\r\n````\r\nand it installs the app on my phone.\r\n\r\nthe first time I open the app, it shows what I'm expecting(various tasks made my different test user accounts), but only for a second. Then the screen refreshes and I get a pretty blank screen with no tasks, no login buttons\r\n\r\nhere is the log from my server (I have an apache server running on my frontend reverse proxying requests to my meteor docker container deployed with mupx):\r\n````\r\n\"GET /sockjs/info?cb=0409hew943 HTTP/1.1\" 200 522 \"http://meteor.local/\" \"Mozilla/5.0 (Linux; Android 5.0.1; HTC One Build/LRX22C.H3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36\"\r\n\"GET /sockjs/628/2p0d0pcp/websocket HTTP/1.1\" 400 230 \"-\" \"Mozilla/5.0 (Linux; Android 5.0.1; HTC One Build/LRX22C.H3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36\"\r\n\"POST /sockjs/628/e4p1bdhg/xhr HTTP/1.1\" 200 492 \"http://meteor.local/\" \"Mozilla/5.0 (Linux; Android 5.0.1; HTC One Build/LRX22C.H3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36\"\r\n\"POST /sockjs/628/e4p1bdhg/xhr_send HTTP/1.1\" 204 424 \"http://meteor.local/\" \"Mozilla/5.0 (Linux; Android 5.0.1; HTC One Build/LRX22C.H3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36\"\r\n\"POST /sockjs/628/e4p1bdhg/xhr HTTP/1.1\" 200 899 \"http://meteor.local/\" \"Mozilla/5.0 (Linux; Android 5.0.1; HTC One Build/LRX22C.H3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36\"\r\n\"POST /sockjs/628/e4p1bdhg/xhr_send HTTP/1.1\" 204 424 \"http://meteor.local/\" \"Mozilla/5.0 (Linux; Android 5.0.1; HTC One Build/LRX22C.H3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36\"\r\n\"POST /sockjs/628/e4p1bdhg/xhr HTTP/1.1\" 200 895 \"http://meteor.local/\" \"Mozilla/5.0 (Linux; Android 5.0.1; HTC One Build/LRX22C.H3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36\"\r\n\"GET /__cordova/manifest.json HTTP/1.1\" 200 686 \"http://meteor.local/\" \"Mozilla/5.0 (Linux; Android 5.0.1; HTC One Build/LRX22C.H3; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/43.0.2357.121 Mobile Safari/537.36\"\r\n\"GET /__cordova/index.html?tsiei9Dcps2x5ZGfr HTTP/1.1\" 200 1244 \"-\" \"Dalvik/2.1.0 (Linux; U; Android 5.0.1; HTC One Build/LRX22C.H3)\"\r\n\"GET /__cordova/b3bb0b55799a5b6650416ee7f32cf5cdb9ba632b.css?nz5fJEMtRFy8hp49d HTTP/1.1\" 200 3425 \"-\" \"Dalvik/2.1.0 (Linux; U; Android 5.0.1; HTC One Build/LRX22C.H3)\"\r\n\"GET /__cordova/0eb7d2741821fe74d36533aad240e2e61b8122b9.js?sb6L4wFZakusewhRP HTTP/1.1\" 200 191234 \"-\" \"Dalvik/2.1.0 (Linux; U; Android 5.0.1; HTC One Build/LRX22C.H3)\"\r\n````\r\nI believe the last 4 GETs that begin with the path /__cordova/ are the meteor server updating the codebase(aka hot code push) on the app, but I built and deployed the server with the exact same codebase that I then built the app from...  I don't know why the referrer is `\"http://meteor.local/\"`\r\n\r\nHere is a gif showing what happens: \r\n\r\n![gif of problem happening](http://i.imgur.com/EmIRELn.gif)\r\n\r\nRunning an iOS simulator of the meteor app I get a similar result.  I ran\r\n\r\n`meteor run ios --mobile-server=http://[serverhostname.com]`\r\n\r\nand I see these log entries from my server:\r\n````\r\n\"GET /sockjs/info?cb=lok1u5vlon HTTP/1.1\" 200 522 \"http://meteor.local/\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"GET /sockjs/359/w81pe2ue/websocket HTTP/1.1\" 400 230 \"-\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"POST /sockjs/359/psp2ikn6/xhr HTTP/1.1\" 200 492 \"http://meteor.local/\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"OPTIONS /sockjs/359/psp2ikn6/xhr_send HTTP/1.1\" 204 532 \"http://meteor.local/\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"POST /sockjs/359/psp2ikn6/xhr_send HTTP/1.1\" 204 424 \"http://meteor.local/\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"POST /sockjs/359/psp2ikn6/xhr HTTP/1.1\" 200 868 \"http://meteor.local/\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"POST /sockjs/359/psp2ikn6/xhr_send HTTP/1.1\" 204 424 \"http://meteor.local/\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"POST /sockjs/359/psp2ikn6/xhr HTTP/1.1\" 200 973 \"http://meteor.local/\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"GET /__cordova/manifest.json HTTP/1.1\" 200 686 \"http://meteor.local/\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"GET /__cordova/b3bb0b55799a5b6650416ee7f32cf5cdb9ba632b.css?JY2pqKYXqgJeKZQat HTTP/1.1\" 200 3425 \"-\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"GET /__cordova/index.html?twCqYMZ53M6ers5hj HTTP/1.1\" 200 1244 \"-\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n\"GET /__cordova/0eb7d2741821fe74d36533aad240e2e61b8122b9.js?etYR55cRYyWEdfthZ HTTP/1.1\" 200 191227 \"-\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12H141 (2055055008)\"\r\n````\r\nUnlike on my android phone, in the simulator I don't see any of the tasks I should see; I just see the meteor loading screen for a while (during which I see the hot code push happening) then I'm shown the app with no tasks.\r\n\r\nI'm running \r\n\r\nmeteor 1.1.0.2\r\nmupx 1.5.1\r\n\r\nhow can I fix this?"},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/126959325","html_url":"https://github.com/meteor/meteor/issues/4855#issuecomment-126959325","issue_url":"https://api.github.com/repos/meteor/meteor/issues/4855","id":126959325,"user":{"login":"cachrisman","id":6521666,"avatar_url":"https://avatars.githubusercontent.com/u/6521666?v=3","gravatar_id":"","url":"https://api.github.com/users/cachrisman","html_url":"https://github.com/cachrisman","followers_url":"https://api.github.com/users/cachrisman/followers","following_url":"https://api.github.com/users/cachrisman/following{/other_user}","gists_url":"https://api.github.com/users/cachrisman/gists{/gist_id}","starred_url":"https://api.github.com/users/cachrisman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cachrisman/subscriptions","organizations_url":"https://api.github.com/users/cachrisman/orgs","repos_url":"https://api.github.com/users/cachrisman/repos","events_url":"https://api.github.com/users/cachrisman/events{/privacy}","received_events_url":"https://api.github.com/users/cachrisman/received_events","type":"User","site_admin":false},"created_at":"2015-08-01T22:45:07Z","updated_at":"2015-08-01T22:45:07Z","body":"excellent!  that fixed the problem...  for the sake of other people who might run into the same problem, when using mup (or mupx), in your mup.json file, you need to set the `\"env\"` key with the hostname and port of your server **as clients will see it**.  I had set it as the server saw it (in a docker container behind an apache reverse proxy).  For example:\r\n````\r\n  \"env\": {\r\n    \"PORT\": 80,\r\n    \"ROOT_URL\": \"http://serverhostname.com\"\r\n  },\r\n````\r\n\r\nThanks for the accurate and insightful help!"}}