首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Phonegap: android中找不到插件

Phonegap: android中找不到插件
EN

Stack Overflow用户
提问于 2013-10-11 03:07:44
回答 1查看 3.7K关注 0票数 0

看起来我把我的配置搞乱了。在更新cordova和一些清理操作后,android无法找到所有插件。上面写着:

代码语言:javascript
运行
复制
10-10 20:49:47.040      611-611/com.phonegap.helloworld W/System.err﹕ java.lang.ClassNotFoundException: org.apache.cordova.ContactManager
10-10 20:49:47.050      611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.Class.classForName(Native Method)
10-10 20:49:47.050      611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.Class.forName(Class.java:234)
10-10 20:49:47.060      611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.Class.forName(Class.java:181)
10-10 20:49:47.060      611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.PluginEntry.getClassByName(PluginEntry.java:117)
10-10 20:49:47.060      611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.PluginEntry.createPlugin(PluginEntry.java:93)
10-10 20:49:47.070      611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:267)
10-10 20:49:47.070      611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.PluginManager.execHelper(PluginManager.java:221)
10-10 20:49:47.070      611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.PluginManager.exec(PluginManager.java:216)
10-10 20:49:47.080      611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
10-10 20:49:47.080      611-611/com.phonegap.helloworld W/System.err﹕ at org.apache.cordova.CordovaChromeClient.onJsPrompt(CordovaChromeClient.java:221)
10-10 20:49:47.091      611-611/com.phonegap.helloworld W/System.err﹕ at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:566)
10-10 20:49:47.091      611-611/com.phonegap.helloworld W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:99)
10-10 20:49:47.091      611-611/com.phonegap.helloworld W/System.err﹕ at android.os.Looper.loop(Looper.java:123)
10-10 20:49:47.100      611-611/com.phonegap.helloworld W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:3683)
10-10 20:49:47.100      611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
10-10 20:49:47.100      611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:507)
10-10 20:49:47.110      611-611/com.phonegap.helloworld W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-10 20:49:47.110      611-611/com.phonegap.helloworld W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-10 20:49:47.110      611-611/com.phonegap.helloworld W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
10-10 20:49:47.121      611-611/com.phonegap.helloworld W/System.err﹕ Caused by: java.lang.NoClassDefFoundError: org.apache.cordova.ContactManager
10-10 20:49:47.130      611-611/com.phonegap.helloworld W/System.err﹕ ... 19 more
10-10 20:49:47.140      611-611/com.phonegap.helloworld W/System.err﹕ Caused by: java.lang.ClassNotFoundException: org.apache.cordova.ContactManager in loader dalvik.system.PathClassLoader[/data/app/com.phonegap.helloworld-1.apk]
10-10 20:49:47.150      611-611/com.phonegap.helloworld W/System.err﹕ at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
10-10 20:49:47.150      611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
10-10 20:49:47.150      611-611/com.phonegap.helloworld W/System.err﹕ at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
10-10 20:49:47.150      611-611/com.phonegap.helloworld W/System.err﹕ ... 19 more
10-10 20:49:47.161      611-611/com.phonegap.helloworld I/System.out﹕ Error adding plugin org.apache.cordova.ContactManager.
10-10 20:49:47.161      611-611/com.phonegap.helloworld D/PluginManager﹕ exec() call to unknown plugin: Contacts
10-10 20:49:47.180      611-611/com.phonegap.helloworld I/Web Console﹕ error in contacts: at file:///android_asset/www/js/contacts.js:30

我怎样才能让插件正常工作?

我正在使用phonegap 3.0.0c

EN

回答 1

Stack Overflow用户

发布于 2013-10-11 03:17:22

如果你导航到你的phonegap根目录并输入"phonegap local plugin list",它会显示什么?

如果什么都没有发生,那么尝试用"phonegap local plugin add link/ to / plugin“重新安装每个插件。

但是,如果插件清单生成了每个已安装插件的输出,请尝试删除插件目录中的"android.json“,然后重新构建您的android项目。

它应该会创建一个新的android项目,其中包含您之前下载的所有插件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19304198

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档