Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cordova: Hot code push not working to Andriod - or I'm not doing it right? #927

Closed
wildhart opened this issue Apr 8, 2018 · 3 comments
Closed

Comments

@wildhart
Copy link

wildhart commented Apr 8, 2018

Mup version: 1.4.3
Meteor version: 1.6.1

I've been deploying happily with mup for ages, web only, and am just getting started with Cordova/Android. I've got it working, except for hot code push to Android, or maybe I've misunderstood what to expect.

Steps to reproduce:

  1. Production testing via USB link to android device - no problem. Android app updates quickly.
  2. mup deploy with Cordova build. Builds and deploys no problem. Web client gets hot code push
  3. sign & align apk, copy to Android device and install. App connects to production server, all good.
  4. Make small change to React template: <th>Name</th> to <td>Name hi</th> (on a route only I can access)
  5. mup deploy. Seems to go well. Connected web client updates. Android app doesn't update. Leave it open for a while (to download update?). Kill app and reload, still not updated.

No Cordova plugins have changed so cordovaCompatibilityVersions.android hasn't changed.

I'm using a CDN via WebAppInternals.setBundledJsCssPrefix(Meteor.settings.public.cdn);

What am I doing wrong?

Mup config

module.exports = {
  servers: {
    one: {
      host: 'virtualinout.com',
      ...
    }
  },
  meteor: {
    name: 'virtualinout',
    path: '../',
    docker: {
      image: 'zodern/meteor:root'
    },
    servers: {
      one: {}
    },
    buildOptions: {
      //serverOnly: true,                     // I've tried all permutations of each of 
      server: 'https://www.virtualinout.com'  // these lines commented or not
    },
    env: {
      ROOT_URL: 'https://www.virtualinout.com',
      MAIL_URL: ...
    },
    enableUploadProgressBar: true,
    deployCheckWaitTime: 300
  },
  proxy: {
    ...
  },
  mongo: {
    version: '3.4.1',
    servers: {
      one: {}
    }
  }
};
@layik
Copy link

layik commented Apr 16, 2018

I doubt it is a MUP issue. Having it here on my iOS. Will update this thread if I get anywhere with my issue.

@wildhart
Copy link
Author

I'm still having this problem, but since my original post I've got the iOS app built and HCP works fine in iOS. HCP still not working on Android though.

Looking at the Android logs when I open the production app on my Android phone yields the following errors:

3820 E MeteorWebApp: Download failure
3820 E MeteorWebApp: com.meteor.webapp.WebAppException: Error downloading asset manifest
3820 E MeteorWebApp: 	at com.meteor.webapp.AssetBundleManager$1.onFailure(AssetBundleManager.java:97)
3820 E MeteorWebApp: 	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:140)
3820 E MeteorWebApp: 	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
3820 E MeteorWebApp: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
3820 E MeteorWebApp: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
3820 E MeteorWebApp: 	at java.lang.Thread.run(Thread.java:776)
3820 E MeteorWebApp: Caused by: java.net.ProtocolException: Expected ':status' header not present
3820 E MeteorWebApp: 	at okhttp3.internal.http.Http2xStream.readHttp2HeadersList(Http2xStream.java:266)
3820 E MeteorWebApp: 	at okhttp3.internal.http.Http2xStream.readResponseHeaders(Http2xStream.java:149)
3820 E MeteorWebApp: 	at okhttp3.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:723)
3820 E MeteorWebApp: 	at okhttp3.internal.http.HttpEngine.access$200(HttpEngine.java:81)
3820 E MeteorWebApp: 	at okhttp3.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:708)
3820 E MeteorWebApp: 	at okhttp3.internal.http.HttpEngine.readResponse(HttpEngine.java:563)
3820 E MeteorWebApp: 	at okhttp3.RealCall.getResponse(RealCall.java:241)
3820 E MeteorWebApp: 	at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:198)
3820 E MeteorWebApp: 	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:160)
3820 E MeteorWebApp: 	at okhttp3.RealCall.access$100(RealCall.java:30)
3820 E MeteorWebApp: 	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:127)
3820 E MeteorWebApp: 	... 4 more
3714 I chromium: [INFO:CONSOLE(75)] "Error: Error downloading asset manifest", source: http://localhost:12768/bb6d78a87664c0a708cb6e02b8b4a85f31fcefa7.js?meteor_js_resource=true (75)

This suggests that come kind of :status header is missing on the manifest, but this is only a problem for Android.

Googling those errors finds a couple of other Meteor users with the same problem, but no resolutions: here on Stackoverflow, using MUP and here on github.

Googling just java.net.ProtocolException: Expected ':status' header not present reveals quite a few non-Meteor references to this problem. HTTP/1.1 on nginx comes up a couple of times.

I've also created a post on the meteor forums.

Does this shed any light on the problem?

@wildhart
Copy link
Author

I've found the solution. Nothing to do with MUP. Updating cordova-plugin-meteor-webapp with:

meteor add cordova:[email protected]

and then redeploying fixed the hot code push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants