Meteor Cordova iOS app splash screen hangs on hot code load

Recreate project from scratch. Cleanup /public folder. It seems to work like a charm for now.

I am very interested on the state of this aswell. We are having issues with iOS hot code push, including the splash screen jam, and another which seems to give a broken patch from the server, even after re-build and re-deploy.

Iā€™m not sure but I think this might be related since I believe that Cordova simply wraps an iOS UIWebView. Soā€¦

NOTE: This is NOT a Cordova app. It is simply a Meteor web app that users can save to the home screen (basically a home screen bookmark) from (mobile) Safari. The app is running in iOSā€™s UIWebView when launched from the home screen. Slightly different code base but, from what I understand, about 99% the same as Safari/WebKit.

Iā€™ve been struggling for a while to figure this one out. Hereā€™s the scenario:

Scenario A:

  1. From Safari, user adds app to home screen while logged IN.
  2. User tries to launch app from home screen icon. App fails to launch. Only error Iā€™m able to observe (from Safari desktop developer tools) is that an error occurred trying to load the main JS file. No exceptions. No console messages. Just Safari dev tools telling me it couldnā€™t load the JS file.

Scenario B:

  1. From Safari, user adds app to home screen while logged OUT.
  2. User tries to launch app from home screen icon. App works just fine.

Is this likely the same hot code push problem?

Could you expand upon this solution please? Weā€™re having the same issue with a similar log.

@tdesc Iā€™m having the exact same symptoms with both my Android and iOS app. App always loads OK the first time and then updates immediately if the server code is newer than the app bundle. But then, if I push a code update to the server, the mobile app crashes 100% of the time when the Hot Code Push kicks in.

Could you please share what you did exactly to solve the problem? ā€œRecreate project from scratch. Cleanup /public folder.ā€

Digging into it and using ADB, it seems the problem comes from here:
Unable to find http://meteor.local/4617fb83e2e062d572a51341059146e4cc776f0c.js?meteor_js_resource=true, will try http://meteor.local/index.html?meteor_js_resource=true

Also, Iā€™m using NGINX in production with SSL, could this be an issue?

Hey guys,

Weā€™ve had this problem before with a app in beta test. Especially iOS
seemed to do this.

Some possible solutions, this combination of things helped us clear the
issue:

  1. Restart the nginx server

  2. Wipe the currently deployed Meteor app from the server

  3. Mup setup and deploy again

  4. When building the mobile app versions, DELETE
    .meteor/local/cordova-build -directory before new builds. Sometimes,
    especially with iOS, we noticed that if we first ran the app using a
    localhost / dev server address, then did a new run using the live server,
    sometimes the app build would still (at least partly) use the localhost /
    dev server. Iā€™m not sure if this is a bug or a feature, but after this
    problem we have been deleting the cordova-build directory before each
    re-build, and have had no issues afterwards.

Make sure nginx isnā€™t serving index.html with caching enabled. That could cause issues if the cached version references assets that no longer exist.

@martijnwalraven You just saved my day. I had been stuck for a day on this issue which is quite critical for me since my customerā€™s iOS app has just been approved in the App Store. It was coming from some caching parameters in my Nginx configuration file. More specifically, in the ā€œlocation /ā€ block:

if ($uri != '/') {
    expires 30d;
} 

On a side note: I took that Nginx config file from somewhere on the web and the comments above this parameter read as follow:
# this setting allows the browser to cache the application in a way compatible with Meteor
# on every applicaiton update the name of CSS and JS file is different, so they can be cache infinitely (here: 30 days)
# the root path (/) MUST NOT be cached

Since this was my first Nginx install, I didnā€™t think of questioning its validity.

Again, many thanks and looking forward to Meteor 1.3 and your work on improving HCP for Cordova apps!