sloanelybutsurely
sloanelybutsurely

Reputation: 94

Meteor/Cordova app fails to download manifest.json for use with autoupdate. What is going wrong?

I am working on a Meteor and Cordova app. I am working to get hot code pushes working and have just added the appcache and autoupdate packages. Appcache and autoupdates are working when viewed in browser but the cordova app can't seem to load the manifest.json (/__cordova/manifest.json) file when a change is detected and thus the autoupdate does not occur.

Here is the log message I get when run on device:

    2015-05-09 09:21:41.326 Feminology[24781:5945164] METEOR CORDOVA DEBUG (autoupdate_cordova.js) Failed to download the manifest null <!DOCTYPE html>
<html manifest="/app.manifest">
<head>
  <link rel="stylesheet" type="text/css" class="__meteor-css__" href="/2c924c2df11aded4c2ddedd0919c5c00ab919f5f.css?meteor_css_resource=true">


<script type="text/javascript">__meteor_runtime_config__ = JSON.parse(decodeURIComponent("%7B%22meteorRelease%22%3A%22METEOR%401.1.0.2%22%2C%22ROOT_URL%22%3A%22https%3A%2F%2Ffeminology-app-staging.herokuapp.com%2F%22%2C%22ROOT_URL_PATH_PREFIX%22%3A%22%22%2C%22autoupdateVersion%22%3A%228%22%2C%22autoupdateVersionRefreshable%22%3A%228%22%2C%22autoupdateVersionCordova%22%3A%228%22%7D"));</script>

  <script type="text/javascript" src="/c9516dba541a4ba6acac011b9fee2e628f5603f6.js"></script>



<meta charset="UTF-8"/>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="/css/ratchet.css"/>
    <link rel="stylesheet" href="/css/ratchet-theme-ios.css" />

    <title>Feminology</title>
</head>
<body>

</body>
</html>

It looks to me like the Meteor server is responding to /__cordova/manifest.json with the empty application template. I am using iron:router so maybe the request isn't being directed properly?

Where should I be looking to debug this issue? Or better yet, how can it be fixed?

Thanks.

Upvotes: 3

Views: 1107

Answers (2)

Alveoli
Alveoli

Reputation: 1212

Happy days. I fixed the issue for the Heroku platform.

The problem was in my buildpack. The popular ones (jordansissel/heroku-buildpack-meteor, AdmitHub/meteor-buildpack-horse) remove android and ios platforms before building to avoid compiling the mobile apps themselves on the server. You can see this happening in Heroku Dashboard > Activity > View build log.

Get round this using my buildpack (forked from horse) which does not remove the platforms, by issuing this command:

heroku buildpacks:set https://github.com/Alveoli/meteor-buildpack-horse.git

Thanks @Guillaume for the pointers.

Upvotes: 1

255kb - Mockoon
255kb - Mockoon

Reputation: 6974

I had exactly the same problem. It appears that I was deploying the application (with Mup) without targeting the android/ios platforms and I was building the mobile app on another machine where I added both platforms. The result was that the server did not create the required files for a mobile app like __cordova/manifest.json.

So you may need to run the following commands on your deployment server and redeploy (rerun mup deploy if you are using it):

meteor add-platform android
meteor add-platform ios

It is not required to actually install the SDK, just target the platform. You will see that Mup will try to build the mobile apps but will skip this step as the SDK are not installed.

Upvotes: 4

Related Questions