Cordova 2.7.0 PushPlugin“cordova无法解析”和“ctx无法解析”

时间:2013-05-15 23:23:59

标签: android apache cordova phonegap-plugins

我做了什么......

  • 使用cordova-android bin中的./create创建了cordova项目
  • 通过cordova-plugman
  • 添加了PushPlugin
  • 将cordova-2.7.0.jar添加到/ libs目录

Cordova在PushPlugin.java中抱怨说“cordova无法解决”......以及其他一些错误......

(PushPlugin.java) Plugin cannot be resolved to a type
(PushPlugin.java) Plugin cannot be resolved to a type
(PushPlugin.java) cordova cannot be resolved
(PushPlugin.java) Plugin cannot be resolved to a type
(PushPlugin.java) Plugin cannot be resolved to a type
(PushPlugin.java) ctx cannot be resolved or is not a field
(PushPlugin.java) ctx cannot be resolved
(PushPlugin.java) ctx cannot be resolved
(PushPlugin.java) ctx cannot be resolved or is not a field
(PushPlugin.java) Plugin cannot be resolved to a type
(PushPlugin.java) The method execute(String, JSONArray, String) of type PushPlugin must override or implement a supertype method

enter image description here

我已经通过Project>>将cordova-2.7.0项目添加到类路径中属性>> JAVA构建路径>>添加Jar文件

我也跑...项目>>清洁

似乎无法想象这一个......已经有好几天了,还有很多谷歌搜索。

最诚挚的问候,约翰 errors

2 个答案:

答案 0 :(得分:1)

请参阅最新提交:NetMatch:PushPlugin github

看起来这个男人在清理最近的cordova版本的插件方面做得很好。仍在等待PushPlugin repo接受拉取请求。

答案 1 :(得分:0)

我正在使用Cordova 2.7.0中的ChildBrowser plugin对类似问题进行故障排除。在插件类声明中将 extends插件更改为扩展CordovaPlugin ,摆脱了我无法解决的“cordova无法解决”错误。看看以下更改是否适合您:

public class PushPlugin extends Plugin {

为:

public class PushPlugin extends CordovaPlugin {