找不到钩子“after_run”的脚本。 Cordova,Ionic,Android [英] No scripts found for hook "after_run". Cordova, Ionic, Android

查看:510
本文介绍了找不到钩子“after_run”的脚本。 Cordova,Ionic,Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Cordova,Ionic和Angular构建Android应用程序。在某些时候,应用程序已停止在设备上运行。当我跑:



离子运行android --verbose



我的平板电脑上有启动画面,但在Mac控制台中我得到:



启动成功后



找不到钩子after_run的脚本。



然后在设备屏幕上我得到了可怕的应用程序错误:
与服务器的连接是不成功(文件:///android_asset/www/index.html)



然后是大崩溃..



<我尝试在代码中查找after_run字符串,但我只在文档中找到它,所以我不知道是什么导致这个。



任何帮助表示赞赏。

解决方案

可以通过添加超时来调用index.html来解决问题



在config.xml文件中添加以下行:

 < preference name = loadUrlTimeoutValuevalue =700000/> 

有关此内容的更多信息,请访问 here


I'm building an Android application using Cordova, Ionic and Angular. At some point the application has stopped running on the device. When I run:

ionic run android --verbose

I get the splash screen on my tablet, but in the mac console I get:

after LAUNCH SUCCESS

No scripts found for hook "after_run".

and then on the device screen I get the dreaded Application Error: The connection to the server was unsuccessful (file:///android_asset/www/index.html)

followed by the big crash..

I tried looking for the "after_run" string in the code, but I only find it in the documentation, so I have no idea what could be causing this.

any help is appreciated.

解决方案

The problem might be solved by adding a timeout to call your index.html

In your config.xml file add this line:

<preference name="loadUrlTimeoutValue" value="700000" />

More about this can be found here.

这篇关于找不到钩子“after_run”的脚本。 Cordova,Ionic,Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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