Ionic-Android平台项目调试时出错:The connection to the server was unsuccessful

来源:互联网 发布:网络电视怎么用遥控器 编辑:程序博客网 时间:2024/05/16 18:23

最近都在搞Ionic的项目,今天在将项目中的Android平台代码提到 Android Studio 上调试时,出现下面的错误:

The connection to the server was unsuccessful. (file:///android_asset/www/index.html)

服务器连接失败,在我们的index.html文件中 1、加载的内容过多,2、依赖模块下载超时

我们可以在项目中的文件config.xml下,重新设置请求时间:

    <platform name="android">        <preference name="loadUrlTimeoutValue" value="600000" />    </platform>
由于是在测试Android平台时,才出现的错误,我们针对Android平台进行设置。

这样并不能根本性的解决问题,只是延长了错误提示框弹出的时间,如果超过了我们设置的60s,依赖模块仍然没有下载完,还是会提示错误。

该问题出现在三星设备中,当我更换设备进行测试时,并没有出现这个问题。

阅读全文
0 0
原创粉丝点击