【发布时间】:2015-08-03 18:37:16
【问题描述】:
通过 Cordova 在 Android 上运行 Meteor 应用程序时遇到许多错误
=> 启动了您的应用程序。 => 应用程序运行在:http://localhost:3000/ (android:http://meteor.local/cordova.js:1169) deviceready 5 秒后未触发。 (android:http://meteor.local/cordova.js:1162) 频道未触发:onDOMContentLoaded (android:http://meteor.local/client/templates/analytics/types/template.bagging_and_tagging_analytics.js:2) Uncaught ReferenceError: Template is not defined (android:http://meteor.local/client/templates/analytics/types/template.biological_notice_analytics.js:2) Uncaught ReferenceError: Template is not defined (android:http://meteor.local/client/templates/analytics/types/template.farmer_triage_analytics.js:2) Uncaught ReferenceError: Template is not defined (android:http://meteor.local/client/templates/analytics/types/template.fertilizer_application_analytics.js:2) Uncaught ReferenceError: Template is not defined (android:http://meteor.local/lib/collections/blocks.js:1) Uncaught ReferenceError: Mongo is not defined (android:http://meteor.local/lib/collections/forms.js:1) Uncaught ReferenceError: Mongo is not defined (android:http://meteor.local/lib/collections/ground_db_users.js:1) Uncaught ReferenceError: Meteor is not defined (android:http://meteor.local/lib/collections/notifications.js:1) Uncaught ReferenceError: Mongo is not defined (android:http://meteor.local/lib/helpers/get_connection_status.js:1) Uncaught ReferenceError: UI is not defined (android:http://meteor.local/client/startup/connection_tracker.js:1) Uncaught ReferenceError: Tracker is not defined (android:http://meteor.local/packages/multiply_iron-router-progress.js:52) Uncaught ReferenceError: Spacebars is not defined I20150522-00:30:55.484(3)?在 Router.configure.waitOn (http://meteor.local/lib/router.js?a620a3574120a8292b544d367fc6fc742b854698:7:8) I20150522-00:30:55.484(3)?在http://meteor.local/packages/iron_router.js?a427868585af16bb88b7c9996b2449aebb8dbf51:1199:36 I20150522-00:30:55.484(3)?在 _.extend.withValue (http://meteor.local/packages/meteor.js?4dc9757b244a30bdf37a732ac4db4026ce56fb6b:981:17) I20150522-00:30:55.485(3)?在 hookWithOptions (http://meteor.local/packages/iron_router.js?a427868585af16bb88b7c9996b2449aebb8dbf51:1198:27) I20150522-00:30:55.485(3)?在http://meteor.local/packages/iron_router.js?a427868585af16bb88b7c9996b2449aebb8dbf51:438:22 I20150522-00:30:55.485(3)?在 Array.forEach (本机) I20150522-00:30:55.485(3)?在 Function..each..forEach (http://meteor.local/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:156:11) I20150522-00:30:55.485(3)?在 RouteController._runRoute (http://meteor.local/packages/iron_router.js?a427868585af16bb88b7c9996b2449aebb8dbf51:437:5) I20150522-00:30:55.485(3)?在 Function.Route.dispatch (http://meteor.local/packages/iron_router.js?a427868585af16bb88b7c9996b2449aebb8dbf51:844:18)
【问题讨论】:
-
我可以知道你在安卓设备上运行的命令吗?
-
您是否准备好使用设备。代替 deviceready,在
Meteor.startup或模板onRendered中调用您的代码 -
我不确定我是否理解“deviceready”而不是“deviceready” 我所有的模板都使用 OnRendered,我没有任何依赖于 Cordova/Phonegap 插件的功能应该将代码包装在Meteor.startup() 块。
-
if (Meteor.isClient) { Meteor.startup(function() { //cordova code }); }这是我的代码。它在我的应用中运行良好
标签: javascript android cordova meteor