流星apk发行版不起作用 [英] Meteor apk release build not working

查看:86
本文介绍了流星apk发行版不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用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只有两个js文件inn index.html:一个名为cordova.js,另一个是触发错误的文件,而调试apk具有项目中index.html中使用的所有软件包,但我仍然不知道如何解决该问题:如何使发行版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

I'm working on a mobile app using Meteor and ionic.

When I built the apk for android, the apk generated (release-unsigned.apk) didn't work on my device. It does show the splash screen, then it just shows a blank white screen and that's it. I run it in bluestacks and used remote debugging to figure out what wrong, and this error came up in the console:

    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

I should also mention that the debug.apk is working just fine.

EDIT:

I unpacked both the debug and the release apks: the difference is that the release apk has only two js files inn index.html: one named cordova.js and the other is the one triggering the error, whilst the debug apk has all the packages used in the project in index.html but I still don't know how to solve the problem: how can I make the packages included in the release apk?

解决方案

After posting the question in meteor forums, one of the MDG staff (Urigo) suggested that I ran the app in angular's strictDi

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

I found out that there was a problem with onEnter of ui-router, because I wrote it like this:

onEnter:function($state){

 //code here
}

But in fact I should have wrote it like this:

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

 //code here
}]

And of course it goes without saying that this should be applied to controllers, services... too For more details, read this: https://docs.angularjs.org/error/$injector/strictdi

This might help too: https://gist.github.com/jonnolen/fff606247f24cae8e81d

这篇关于流星apk发行版不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆