`
maxer025
  • 浏览: 79601 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

Application Error - The connection to the server was unsuccessful. (file:///and

 
阅读更多
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>
分享到:
评论

相关推荐

    win 3.11 for workgroup tcpip支持

    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"意为“抑制通货膨胀”,所以...

    Loadrunner打不开WebTours的解决方法

    今天安装了Loadrunner9.0后,发现打开LR示例页面的时候会显示如下错误:  Internalerror:yourrequestwasunsuccessful  CannotcreateCGIprocess–programnotfound  解决方法:  打开WebTours文件夹下的run.bat,...

    SEP CleanWipe 12.1.6318.6100

    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@ Partition Recovery v.5.0.357 Enterprise Toolkit. Retail

    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 ...

    Wiley-Schneier on Security(2008).pdf

    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 ...

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    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 from A to Z

    著名培训机构的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...........

    2020春七年级英语下册Module9LifehistoryUnit2Hedecidedtobeanactor同步测试新版外研版

    这篇内容主要围绕七年级英语下册Module9 Life History Unit2 "He decided to be an actor"进行了一次同步测试,涉及到了词汇、短语、重点知识讲解以及相关拓展。以下是相关知识点的详细说明: 1. 单词学习: - ...

    LTE from A to Z (part1 of 3)

    著名培训机构的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...........

    虚拟机VMware 下的UbuntuUSB 设备识别问题的解决方法

    The connection to the VMware USB Arbitration Service was unsuccessful. Please check the status of this service in the Microsoft Management Console.” - 在虚拟机Linux系统下插入U盘也无法被识别。 **...

    雅思听力模拟试题及答案.docx

    ##### 第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 from A-Z 培训教材 (part2 of 3)

    著名培训机构的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...........

    TensorFlow加载模型时出错的解决方式

    \windows\tensorflow\core\framework\op_kernel.cc:993] Not found: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for params_cifar.ckpt 在Windows下要把目录写对才可以。 ...

    大学英语UuTxt英语四级词汇

    - **例句**:He decided to abandon the project after several unsuccessful attempts. ##### 2. ability (E'biliti) n. - **含义**:能力;才能。 - **例句**:Her ability to solve complex problems is ...

    英语4级词汇

    - **例句**: He decided to abandon the project after months of unsuccessful attempts. ##### 2. ability (n.) - **含义**: 能力,才能。 - **例句**: Her ability to solve complex problems is remarkable. #...

    Goulet, L. R. and Baltes, P. B. (Eds.) Life-span Developmental Psychology: Research and Theory. New York: Acacemic Press, 1970, 580 p., [dollar]14.50

    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 ...

Global site tag (gtag.js) - Google Analytics