流星APK发布版本无法正常工作

问题描述 投票:0回答:1

我正在使用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正常工作。

编辑:

我同时打开了调试和发行版APK的包装:区别在于,发行版apk在index.html中只有两个js文件:一个名为cordova.js,另一个是触发错误的文件,而调试apk具有所有软件包。用于index.html中的项目,但我仍然不知道如何解决该问题:如何制作发行版apk中包含的软件包?

android angularjs meteor ionic-framework angular-meteor
1个回答
1
投票

在流星论坛上发布问题后,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

© www.soinside.com 2019 - 2024. All rights reserved.