Cordova app (Android) not reloading after hot code push with deployed app

Hmmm, I’m not sure what the best way to deal with this would be. I’ll ask around and get back to you!

Hey @martijnwalraven.

I was wondering if you had some new information on the requirements for building for the web.cordova architecture without the hassle of hosting SDKs and system environments.

Cheers.

1 Like

We’ve been talking about it internally, and we agree we need to find a solution for this. One option we discussed would be to allow adding a cordova-server-only platform. Another option might be to add a --server-only option to meteor build.

@blouze @soulou: In 1.3-beta.12, I’ve added a --server-only option to meteor build that doesn’t require the mobile SDKs to be installed on the build machine, but that will still build web.cordova when ios or android platforms have been added to the project.

Hi @martijnwalraven

Great, thanks for adding this to the build chain, it will be very useful for us :slightly_smiling:

Hey @martijnwalraven!
As a meteor-head, I want to thank you all at MDG for your hard work to bring us 1.3

I just upgraded my mobile app to find out if it would solve my previous problem.

I am able to get the HCP working with a published Cordova app built with --server option set on a locally running instance (I had to build the app first, and then run meteor with a target specified as pointed out here).

After deploying the app in production, I can see the same behaviour as before, web client gets refreshed, no cigar for Cordova.

Values for ROOT_URL is set alright in runtime config, I even get a value for autoupdateVersionCordova.

Pls, halp.

2 Likes

Are both the app and your server on Meteor 1.3?

Can you check if the asset manifest is served at /__cordova/manifest.json on your production server?

Any error messages either in logcat or with Chrome remote debugging?

I forgot to mention __cordova/manifest.json gets served.

BUT, opening logcat (thx for the tip) got me:

Error: Skipping downloading new version because the Cordova platform version or plugin versions have changed and are potentially incompatible

cordova --version gives 6.1.0

Trying to update incriminated plugins… Getting back at you after that.

Nope, still no luck with my issue :cry:

I tried removing every single cordova plugins (including crosswalk), I still get the same error.

The issue is that hot code push can only update JavaScript code, so to protect against situations where updated code depends on (versions of) plugins that are not in the native app bundle, we block hot code push when either the platform version or the set of plugins have changed.

You may have installed or updated plugins yourself, but Meteor 1.3.1 also updates some plugins included by default. So if your server is running Meteor 1.3.1 and your app was build using Meteor 1.3, hot code push will be blocked until you update the app on the app store.

Is this the case, that hot code will be blocked for every minor update to Meteor, if the app and server are not running the same version?

This will be a huge problem for us. I can see the need to do this between 1.2 and 1.3 as it was a major update to mobile with lots of breaking changes. However, this is will be untenable for us if we have to re-submit to app store for every minor bug fix release of Meteor. I can potentially see the need to block hot code push if cordova plugin versions change, but not for Meteor IOS/Android versions.

Please clarify, thanks.

It is not about the version of Meteor per se, so this shouldn’t happen for every minor update. But we did update some of the versions of default plugins in Meteor 1.3.1, so that is what triggered this.

I updated my project to 1.3.1 today and I can see in __meteor_runtime_config__ that this is what’s running in production…

Unless absolutely required because of a major blocking bug in any of the default plugins bundled with Meteor I’d like to suggest that we NOT update these plugins between minor (x.x.x) releases and save these changes for major releases (x.x.0) going forward.

In addition, this should be documented in the release notes and history as this type of change is really a “breaking change” for any deployed mobile app.

Thanks again for all your hard work and great improvements with Meteor mobile.

3 Likes

@martijnwalraven i have a very similar issue while developing locally. The manifest file seems to not be served when i start the server with a simple

meteor run --settings “config/settings-local.json” --mobile-server “localIp:3000”

as soon as i run with ‘meteor run android-device’ the manifest file is served. But sometimes i want to just start the app via android studio to test some stuff. This was different some time ago and it think it makes sense to include server the manifest whenever there is a mobile-server flag and/or there are ios and android as platforms included.

http://MY.LOCAL.IP:3000/__cordova/manifest.json

Is there a special flag we could use to fix this while developing right now?

@nerdmed: This was actually a deliberate change made as a result of this issue, because people wanted the ability to run the app in the browser without building the Cordova bundle. A few people have noted they preferred the previous behavior, so maybe we need to somehow make this configurable.

@martijnwalraven ok i see, i dont know how much time you have right now for this. I could work on a PR to make it customizable. I think the options are:

  • Enviroment variable
  • Detect --mobile-server Flag (why should i use the mobile server flag when running on browsers only)

I think detecting the mobile server flag makes most sense. What do you think?

I was just scouting around the forums to find out why my app wasn’t hot code pushing, them came across this post. A big +1 to not make any cordova updates or anything that would disable hot code push in minor versions, this caused us some headaches today wondering why our app wasn’t updating.

@markoshust same here, all my developers were going crazy because of this - maybe i will find the time for a quick fix on the weekend

@martijnwalraven I have been running into similar problems ( Error: Skipping downloading new version ... ) in development. While we’re not in production yet I can see this causing issues for us regardless of how Meteor’s own cordova dependencies are handled going forward.

I can understand the point made by @skirunman in regards to not updating plugin dependencies unless necessary but at the same time why should we limit updates to cordova components based on this? In our case we also have our fair share of plugin (some in-house) dependencies that will likely change frequently but will generally remain compatible.

Do you think it would make more sense to provide a means to override this compatibility check in some way (perhaps thru mobile-config.js) to define some type of compatibility level (i.e. a-plugin 1.0.0 & 1.0.1 are compatible) which would be generated in the manifest and taken into account during this check? Meteor itself could even inject its own pre-defined compatibility maps for said major version if it makes sense but beyond that it would be up to us to decide and define what is considered compatible and what isn’t in regards to cordova upgrades.

Thanks for all your awesome work!

1 Like