Application Error - The connection to the server was unsuccessful. (file:///android_asset/www/index.html)
问题描述:
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 -->
方法四:
index.html 里面https引用copy到本地,直接从本地引用,不通过http
<!--script src="https://cdn.rawgit.com/auth0/angular-storage/master/dist/angular-storage.js"></script-->
<script src="lib/angular-storage/dist/angular-storage.js"></script>
分享到:
相关推荐
this indicates that the server was unavailable and that your lease has expired. DHCP will (in the background) continue to try to acquire a valid lease while Windows for Workgroups continues to run ...
40. 题目:In the 1970's, many governments' efforts to curb inflation were unsuccessful. 选项:[ A ]resist [ B ] induce [ C ] sustain [ D ] control 解析:"curb inflation"意为“抑制通货膨胀”,所以...
今天安装了Loadrunner9.0后,发现打开LR示例页面的时候会显示如下错误: Internalerror:yourrequestwasunsuccessful CannotcreateCGIprocess–programnotfound 解决方法: 打开WebTours文件夹下的run.bat,...
When the usual uninstall methods have been unsuccessful, such as using the Windows Control Panel, you can use the CleanWipe tool to remove a component. SEP CleanWipe 12.1.6465.6200: ...
Active@ File Recovery utility is also included to allow you to save your files and folders in case of unsuccessful partition recovery (for example, the file system itself is severely damaged and ...
The book, authored by Bruce Schneier, is an extensive exploration of various aspects of security, particularly as they relate to technology and policy. Below, we will delve into each chapter and ...
g) The VsGui program was modified to add sweep function, and the associated files were added to the file manifest. The new functions are assigned higher ordinal numbers than the earlier commands, so ...
著名培训机构的LTE培训教材。 深入浅出,从基本概念到深入描述。...1.3.1.3 Separate entities for user plane and control plane in the EPC......36 1.3.1.4 Combined Serving Gateway and MME...........
这篇内容主要围绕七年级英语下册Module9 Life History Unit2 "He decided to be an actor"进行了一次同步测试,涉及到了词汇、短语、重点知识讲解以及相关拓展。以下是相关知识点的详细说明: 1. 单词学习: - ...
著名培训机构的LTE培训教材。 深入浅出,从基本概念到深入描述。...1.3.1.3 Separate entities for user plane and control plane in the EPC......36 1.3.1.4 Combined Serving Gateway and MME...........
The connection to the VMware USB Arbitration Service was unsuccessful. Please check the status of this service in the Microsoft Management Console.” - 在虚拟机Linux系统下插入U盘也无法被识别。 **...
##### 第1题:Students want to keep the Self-Access Centre because... - **选项分析**: - A. They enjoy the variety of equipment. - B. They like being able to work on their own. - C. It is an ...
著名培训机构的LTE培训教材。 深入浅出,从基本概念到深入描述。...1.3.1.3 Separate entities for user plane and control plane in the EPC......36 1.3.1.4 Combined Serving Gateway and MME...........
\windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for params_cifar.ckpt 在Windows下要把目录写对才可以。 ...
- **例句**:He decided to abandon the project after several unsuccessful attempts. ##### 2. ability (E'biliti) n. - **含义**:能力;才能。 - **例句**:Her ability to solve complex problems is ...
- **例句**: He decided to abandon the project after months of unsuccessful attempts. ##### 2. ability (n.) - **含义**: 能力,才能。 - **例句**: Her ability to solve complex problems is remarkable. #...
effectively in a special class situation, and reintegrate the children successfully into the regular school. However, recent research suggests that some Re-ed teachers were unsuccessful in their ...