admin管理员组

文章数量:1516870

一:android app 启动错误,即出现:Application Error - The connection to the server was unsuccessful. ( )
分析:是PhoneGap某些版本的BUG,尤其在index.html加载的内容较多的时候容易出现,反正我是遇到过好多次

解决办法:(2,3都验证过,有效)

方法1:更新到PhoneGap的最新版本;

方法2:设置加载超时属性

super.setIntegerProperty("loadUrlTimeoutValue",10000);

完整代码如下:

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl(" ");
super.setIntegerProperty("loadUrlTimeoutValue", 10000);
方法3:过渡法:

将indext.html更名为main.html,然后新建一个index.html页面,内容如下:

<!doctype html> <html> <head> <title>tittle</title> <script> window.location='./main.html'; </script> <body> </body> </html>

主要原理就是通过一个过渡页面,把加载首页的内容最小化。

二:PhoneGap Android Error initializing Cordova:Class not found
分析:环境配置有问题

解决办法(试验有效):

将安装包中的xml/config.xml拷到项目中res/xml下面(没有xml文件夹则创建一个)

待续...

本文标签: 方法中的编程