Phonegap:在android中找不到插件

时间:2013-10-10 19:07:44

标签: android cordova phonegap-plugins

似乎我用我的配置弄乱了一些东西。在更新了cordova和一些清理操作之后,所有插件都无法通过android找到。它说:

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

1 个答案:

答案 0 :(得分:0)

如果你导航到你的phonegap根目录并输入“phonegap本地插件列表”,它会说什么?

如果没有任何反应,请尝试使用“phonegap local plugin add link / to / plugin”重新安装每个插件。

但是如果插件列表为每个已安装的插件生成输出,请尝试删除插件目录中的“android.json”并再次构建您的android项目。

它应该创建一个包含您之前下载的所有插件的新Android项目。

相关问题