Cordova通知插件安装失败(Cordova 3.6) [英] Cordova notification plugin failed installation (Cordova 3.6)
问题描述
我已将一个项目从Cordova 3.4更新到3.6.3,一切都已经分开(像往常一样)。
I've updated a project from Cordova 3.4 to 3.6.3 and everything has fallen apart (as usual).
但是具体来说, $ c> org.apache.cordova.dialogs 插件在ios上的运行时不工作。
But specifically, here, the org.apache.cordova.dialogs
plugin is not working in runtime on ios.
Cordova说插件已安装: p>
Cordova says the plugin is installed:
$ cordova plugins ls
org.apache.cordova.dialogs 0.2.9 "Notification"
org.apache.cordova.vibration 0.3.10 "Vibration"
在config.xml中目录)我已添加:
In config.xml (the one outside of the platforms directory) I have added:
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>
在JavaScript中,我尝试创建一个类似这样的警报
When, in JavaScript, I try to create an alert like this (and yes device is ready):
navigator.notification.alert("Test alert", null);
我在XCode调试器中抛出了这个错误(为了易读性,我添加了换行符)
I get this error thrown in the XCode debugger (I added line breaks for legibility)
2014-09-18 15:03:26.327 Milk[3045:60b]
CDVPlugin class CDVNotification (pluginName: Notification) does not exist.
2014-09-18 15:03:26.328 Milk[3045:60b]
ERROR: Plugin 'Notification' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2014-09-18 15:03:26.329 Milk[3045:60b]
-[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [
"INVALID",
"Notification",
"alert",
[
"Test alert",
"Alert",
"OK"
]
]
我尝试过 cordova插件rm
/ cordova插件添加
并运行 cordova platform rm
添加和删除ios。
I have tried cordova plugin rm
/ cordova plugin add
and also running cordova platform rm
to add and remove ios.
所以:CDVPlugin类CDVNotification(pluginName:Notification)不存在。
So: "CDVPlugin class CDVNotification (pluginName: Notification) does not exist."?
Cordova说它安装了,我该如何解决? p>
Cordova says it's installed, how can I solve this?
推荐答案
我全盘降级到Cordova 3.5,现在看起来还行。
I globally downgraded to Cordova 3.5 and now it seems OK.
sudo npm uninstall cordova -g
sudo npm install -g cordova@3.5.0-0.2.7
这篇关于Cordova通知插件安装失败(Cordova 3.6)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!