Search code examples
cordovameteorherokuiron-router

Meteor heroku Error parsing asset manifest


I have checked this and this, and every possible article out there. Even checked Meteor Guide and getting crazy very soon because of this problem!

Problem: The problem is getting Hot Code Push (HCP) to work on device once pushed to ROOT_URL mentioned below.

Environment:

Mac macOS Sierra
Meteor  : 1.5.1
Router  : iron:[email protected]
Hosting : Heroku
Deploy Source: GitHub
Cordova : 7.0.1
Android tools target: 23
Buildpack: https://github.com/AdmitHub/meteor-buildpack-horse.git

Buildpack Options:
  BUILDPACK_PRELAUNCH_METEOR = 0
  ROOT_URL: https://grocer-eg.herokuapp.com/

run command:

meteor run android-device -s settings.json --mobile-server https://grocer-eg.herokuapp.com

AND

meteor build --mobile-settings settings.json --server https://grocer-eg.herokuapp.com --debug --directory ../my-output-directory/

Log:

App running at: http://localhost:3000/     
=> Started app on Android Device.             
I20170830-19:43:30.364(3)? int logctl_get(): open '/dev/hwlog_switch' fail -1, 13. Permission denied
I20170830-19:43:30.518(3)? 
I20170830-19:43:30.521(3)? Note: log switch off, only log_main and log_events will have logs!
I20170830-19:43:30.522(3)? 08-30 19:43:09.277 14167 14167 I CordovaLog: Changing log level to DEBUG(3)
I20170830-19:43:30.522(3)? 08-30 19:43:09.379 14167 14167 I chromium: [INFO:library_loader_hooks.cc(144)] Chromium logging enabled: level = 0, default verbosity = 0
I20170830-19:43:30.523(3)? 08-30 19:43:10.121 14167 14167 I MeteorWebApp: Serving asset bundle with version: d723bae98470d4b496c7c54898abf69b06ce144b
I20170830-19:43:30.524(3)? 08-30 19:43:10.498 14167 14263 E chromium: [ERROR:BudgetService.cpp(165)] Unable to connect to the Mojo BudgetService.
I20170830-19:43:30.524(3)? 08-30 19:43:11.490 14320 14380 I chromium: [INFO:library_loader_hooks.cc(144)] Chromium logging enabled: level = 0, default verbosity = 0
I20170830-19:43:30.524(3)? 08-30 19:43:12.253 14167 14167 I chromium: [INFO:CONSOLE(9676)] "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.", source: http://localhost:12128/packages/jquery.js?hash=e5fc9cebb2e37c48ddfaf76e0ab0b77cb6ce6e52 (9676)
I20170830-19:43:30.525(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp: Download failure
I20170830-19:43:30.525(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp: com.meteor.webapp.WebAppException: Error parsing asset manifest
I20170830-19:43:30.525(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at com.meteor.webapp.AssetManifest.<init>(AssetManifest.java:80)
I20170830-19:43:30.525(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at com.meteor.webapp.AssetBundleManager$1.onResponse(AssetBundleManager.java:112)
I20170830-19:43:30.526(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at okhttp3.RealCall$AsyncCall.execute(RealCall.java:133)
I20170830-19:43:30.526(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
I20170830-19:43:30.526(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
I20170830-19:43:30.526(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
I20170830-19:43:30.527(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at java.lang.Thread.run(Thread.java:776)
I20170830-19:43:30.527(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp: Caused by: org.json.JSONException: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject
I20170830-19:43:30.527(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at org.json.JSON.typeMismatch(JSON.java:111)
I20170830-19:43:30.528(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at org.json.JSONObject.<init>(JSONObject.java:160)
I20170830-19:43:30.528(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at org.json.JSONObject.<init>(JSONObject.java:173)
I20170830-19:43:30.528(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   at com.meteor.webapp.AssetManifest.<init>(AssetManifest.java:39)
I20170830-19:43:30.528(3)? 08-30 19:43:15.121 14167 14505 W MeteorWebApp:   ... 6 more

UPDATED NOTE:

http://localhost:3000/__cordova/manifest.json returns a huge json file successfully, but https://grocer-eg.herokuapp.com/__cordova/manifest.json is routed as not found template!

I have been searching while not understanding 90% of the mentioned articles, and by following each and every recommendation in them.


Solution

  • So apparently i was doing nothing wrong except using the buildpack i was using.

    The problem with the build pack is that it was removing the android platform before running meteor here and here

    So i just forked it and commented out these lines, and it worked as expected.

    Now i have HCP working :D