Application Error - The connection to the server was unsuccessful. (file:///android_asset/www/index...

问题描述:

PhoneGap+Sencha Touch开发的应用,打包后的APP或者调试期间,在启动的时候提示如下信息:
Application Error - The connection to the server was unsuccessful. 
(file:///android_asset/www/index.html) 
 
问题分析:
这个应该是PhoneGap某些版本的BUG,尤其在index.html加载的内容较多时容易出现。
 
解决方法:
方法1:更新到PhoneGap的最新版本;
方法2:设置加载超时属性
super.setIntegerProperty("loadUrlTimeoutValue",10000);  

完整代码如下(设置超时为 10 秒)

@Override
publicvoid onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    super.loadUrl("file:///android_asset/www/home/index.html");
    super.setIntegerProperty("loadUrlTimeoutValue",10000);
}

方法3:改名法
把index.html更名为main.html,然后新建一个index.html页面,内容如下:
<!doctype html> <html> <head> <title>tittle</title> <script> window.location='./main.html'; </script> <body> </body> </html>
 
主要原理就是通过一个过渡页面,把加载首页的内容最小化。
 
找到项目中res/xml目录下的config.xml,把你的外网的域名地址添加到配置中 
<access origin="http://example.com" /> <!--allow any secure requests to example.com -->

转载于:https://www.cnblogs.com/tianyalu/p/4542195.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Foreword 5 1 Scope 6 2 References 6 3 Definitions, symbols and abbreviations 6 3.1 Definitions 6 3.2 Symbols 6 3.3 Abbreviations 7 4 General 7 4.1 Procedure specification principles 7 4.2 Forwards and backwards compatibility 7 4.3 Specification notations 7 5 X2AP services 8 5.1 X2AP procedure modules 8 5.2 Parallel transactions 8 6 Services expected from signalling transport 8 7 Functions of X2AP 8 8 X2AP procedures 8 8.1 Elementary procedures 8 8.2 Basic mobility procedures 9 8.2.1 Handover Preparation 9 8.2.1.1 General 9 8.2.1.2 Successful Operation 9 8.2.1.2.1 UE History Information 10 8.2.1.3 Unsuccessful Operation 10 8.2.1.4 Abnormal Conditions 11 8.2.2 SN Status Transfer 11 8.2.2.1 General 11 8.2.2.2 Successful Operation 11 8.2.2.2 Abnormal Conditions 12 8.2.3 Release Resource 12 8.2.3.1 General 12 8.2.3.2 Successful Operation 12 8.2.3.3 Unsuccessful Operation 13 8.2.3.4 Abnormal Conditions 13 8.2.4 Handover Cancel 13 8.2.4.1 General 13 8.2.4.2 Successful Operation 13 8.2.4.3 Unsuccessful Operation 13 8.2.4.4 Abnormal Conditions 13 8.3 Global Procedures 13 8.3.1 Load indication 13 8.3.1.1 General 13 8.3.1.2 Successful Operation 14 8.3.1.2 Abnormal Conditions 14 8.3.2 Error Indication 14 8.3.2.1 General 14 8.3.2.2 Successful Operation 14 8.3.2.3 Unsuccessful Operation 15 8.3.2.4 Abnormal Conditions 15 8.3.3 X2 Setup 15 8.3.3.1 General 15 8.3.3.2 Successful Operation 15 8.3.3.3 Unsuccessful Operation 15 8.3.3.4 Abnormal Conditions 16 8.3.4 Reset 16 8.3.4.1 General 16 8.3.4.2 Successful Operation 16 8.3.4.3 Unsuccessful Operation 16 8.3.4.4 Abnormal Conditions 16 9 Elements for X2AP Communication 16 9.1 Message Functional Definition and Content 16 9.1.1 Messages for Basic Mobility Procedures 16 9.1.1.1 HANDOVER REQUEST 16 9.1.1.2 HANDOVER REQUEST ACKNOWLEDGE 17 9.1.1.3 HANDOVER PREPARATION FAILURE 18 9.1.1.4 SN STATUS TRANSFER 19 9.1.1.5 RELEASE RESOURCE 19 9.1.1.6 HANDOVER CANCEL 20 9.1.2 Messages for global procedures 20 9.1.2.1 LOAD INFORMATION 20 9.1.2.2 E

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值