流星Heroku错误解析资产明显



我已经对此进行了检查,并在那里进行了所有可能的文章。甚至检查了流星指南,并且由于这个问题很快就发疯了!

问题:问题是将加热代码推送(HCP)在下面提到的 root_url 时在设备上工作。

环境:

Mac macOS Sierra
Meteor  : 1.5.1
Router  : iron:router@1.1.2
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/

运行命令:

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

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

日志:

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

更新注:

http://localhost:3000/__cordova/manifest.json成功返回一个巨大的JSON文件,但是https://grocer-eg.herokuapp.com/__cordova/manifest.json被路由为未找到模板!

我一直在搜索,同时又不了解上述文章的90%,并遵循其中的每一个建议。

流星构建记得当地运行时的最后一个设置,这在技术上是一个错误,但从未解决,因为有解决方法。

为了构建APK,您需要确保您的构建区域是新鲜的,此脚本可以:

#!/bin/bash
#
# Script to generate android apk (pre-cursor)
# Remove previous build (ensures a clean build)
#
rm -rf .meteor/local/cordova-build
# Remove the app from the device (makes installation more reliable)
#
adb uninstall <%=COM_NAME%>
# Run meteor, which will build a debug apk and install it on the device
#
meteor --mobile-server <%=ROOT_URL%> run android-device

这是我用来为每个不同环境生成脚本的模板。

这样做之后,您的构建区域现在已经用目标环境的URL进行底漆,并且设备上的APK已准备好适合该环境。现在使用相同的URL进行构建:

meteor build --server <%=ROOT_URL%>

这有点令人费解。我最终写了一堆脚本,以使我可以轻松地管理几个环境,一次为每台开发机器,分期,测试和生产。

您可以手动执行所有操作,但容易出错。一个错误,您必须重新开始,无论如何,构建和安装周期都需要一点时间。如果您愿意,我可以与您分享脚本。

,显然我没有做错了,除了使用我正在使用的buildpack。

构建包的问题在于它在此处和此处运行流星之前删除了Android平台

所以我只对其进行了分叉并评论了这些行,并且按照预期的方式工作。

现在我有HCP工作:D

最新更新