Meteor apk 发布版本不工作

Meteor apk release build not working

我正在使用 Meteor 和 ionic 开发移动应用程序。

当我为 android 构建 apk 时,生成的 apk (release-unsigned.apk) 无法在我的设备上运行。 它确实显示了初始屏幕,然后它只显示了一个空白的白色屏幕,仅此而已。 我 运行 它在 bluestacks 中并使用远程调试来找出问题所在,控制台中出现了这个错误:

    Uncaught Error: [$injector:modulerr] Failed to instantiate module SoldatyApp due to:
Error: [$injector:unpr] Unknown provider: e
http://errors.angularjs.org/1.4.8/$injector/unpr?p0=e
    at http://localhost:12312/fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113:484
    at http://localhost:12312/fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113:20192
    at r (http://localhost:12312/fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113:19362)
    at Object.i [as invoke] (http://localhost:12312/fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113:19699)
    at r (http://localhost:12312/fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113:18750)
    at http://localhost:12312/fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113:18874
    at o (http://localhost:12312/fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113:910)
    at p (http://localhost:12312/fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113:18651)
    at tt (http://localhost:12312/fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113:20341)
    at s (http://localhost:12312/fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113:7674)
http://errors.angularjs.org/1.4.8/$injector/modulerr?p0=SoldatyApp&p1=Error…e9a0234fdb385aba26e0105b653b78.js%3Fmeteor_js_resource%3Dtrue%3A113%3A7674) fcfcd288ece9a0234fdb385aba26e0105b653b78.js?meteor_js_resource=true:113

我还应该提到 debug.apk 工作正常。

编辑:

debug和release apk我都解压了:不同的是release apk只有两个js文件inn index.html:一个叫cordova.js,另一个是触发错误的,虽然debug apk中包含项目中使用的所有包 index.html 但我仍然不知道如何解决问题:如何使包包含在release apk中?

在流星论坛上发布问题后,MDG 的一位工作人员 (Urigo) 建议我 运行 angular 的 strictDi

中的应用程序

https://docs.angularjs.org/guide/di

发现是ui-router的onEnter有问题,因为我是这样写的:

onEnter:function($state){

 //code here
}

但其实我应该这样写的:

onEnter:['$state',function($state){

 //code here
}]

当然,不言而喻,这也应该应用于控制器、服务…… 有关更多详细信息,请阅读以下内容: https://docs.angularjs.org/error/$injector/strictdi

这也可能有帮助: https://gist.github.com/jonnolen/fff606247f24cae8e81d