Phonegap解决错误:Error initializing Cordova:Class not found

Phonegap  解决错误: 

 Alert

 [ERROR]Error initializing Cordova:Class not found

 

 

发现bug后找原因   网上说是  因为找不到     res/xml  文件夹下的  config.xml 文件;

但我有这个config.xml

我想了一下 是不是因为没有找到指定的config.xml中的  feature配置 

 

最后找到了   是因为我调用系统的 Device 信息 没有加标签  

 

[html] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. <!-- 设备 -->  
  2.    <feature name="Device" >  
  3.        <param  
  4.            name="android-package"  
  5.            value="org.apache.cordova.device.Device" />  
  6.    </feature>  


 

出现这个bug  的原因是调用phonegap的插件 没有找到相对应的java类 

解决思路:

1 检查  res/xml 目录下有无   config.xml 文件

2 检查 config.xml 文件中  feature 标签 是否完善

posted @ 2016-02-03 17:14  wikiki  阅读(437)  评论(0)    收藏  举报