Hot Code Push - Android < 5.x


#1

Hi,

right now we are developing an application with meteor.
We are currently testing this app on android phones with these versions: v4.1, 4.3, 5.0 and 5.3.

The version 4.1 and 4.3 always struggle with hot code push feature resulting in an white screen (while hot code push) then reload, but afterwards no connectivity anymore to the server.
(Android debugging tools reveal that hot code push was done). The index.html in www/application reveals that ROOT_URL is set correctly assuming that it is not needed anymore to set this environment variable explicitly.

Version 5.0 and 5.3 auto-update correctly to the latest version.

Is ths normal?

For the sake of completeness you ´ll find my server and app commands in the following:

Actually I build the app either by building (and signing afterwards) or by running and copying the apk:

The server is started on my-server by:

  • nohup meteor --settings ./private/Config.json --port 3001 > …/log/log-app.log &

Thank you in advance and looking forward to your answers.


#2

I’m not aware of any specific Hot Code Push issues with Android 4.x, but I can’t test this right now because I don’t have devices with those versions. Maybe someone else has experiences to add.

Apart from the fact that it does seem to work under 5.x, your problem sounds like you may have forgotten to set ROOT_URL on the server. Because the server is responsible for generating a new index.html that gets downloaded to the device on Hot Code Push, it needs to be aware of the URL the client should connect to so it can use this to populate __meteor_runtime_config__.


#3

I had a similar problem with an in-house app I was developing about 6 months back. Early versions were fine, but after it grew and I added a bunch of plugins the hot-code push stopped working (blank white screen). My fix at the time was to clear the app-cache on the phone. The next time the app launched it would grab the newest code and work fine. But only that first time. Any further code updates wouldn’t push.


#4

Thank you very much both for your answer. Finally it works, because of ROOT_URL and --DEBUG option.

Actually I am aware of this post as well: Deploying server for Meteor Cordova App where you provided already useful answers.

So after your answer I added now the environment var ROOT_URL=http://my-server.net:3001, but it won´t help.
(Actually before I never added this var, because I always tried to get client and server the same, which means, that there has not been a hot code push…).
But today I used the build comand again and forgot to use “–debug” option, which results it seems in a hot code push.
I understand that the server ran per default in debug mode until you use the “–production” option, while the build generates per default a production build until you the option “–debug”…

Tbh. I struggled in general with this whole topic since 2 months and I think now I got it, but I would really suggest to extend the tutorials to explain this (build and deploy topic) in a better way. At least for me these things were not that clear.