PhoneGap 常见错误集锦及解决办法
PhoneGap 常见错误集锦及解决办法
一:android app 启动错误,即出现:Application Error - The connection to the server was unsuccessful. (**file:///android_asset/www/index.html**)
分析:是PhoneGap某些版本的BUG,尤其在index.html加载的内容较多的时候容易出现,反正我是遇到过好多次
解决办法:
方法1:更新到PhoneGap的最新版本;
方法2:设置加载超时属性
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl(“file:///android_asset/www/home/index.html”);
super.setIntegerProperty(“loadUrlTimeoutValue”, 10000);
二:控制台错误:PhoneGap Android Error initializing Cordova:Class not found
分析:环境配置有问题
解决办法(试验有效):
将安装包中的xml/config.xml拷到项目中res/xml下面(没有xml文件夹则创建一个)
想要整理更多的碎片知识,扫码关注下面的公众号,让我们在哪里接着唠!
还没有评论,来说两句吧...