简体   繁体   English

科尔多瓦:如何将现有的自定义插件2.3添加到项目3.0

[英]Cordova: How to add existing custom plugin 2.3 into project 3.0

I am new to PhoneGap development. 我是PhoneGap开发的新手。 I have a custom plugin created in version 2.3 and I have to use in version 3.0. 我在版本2.3中创建了一个自定义插件,并且必须在版本3.0中使用。

I tried to use using below command but could not succeeded: cordova plugin add /Desktop/SuperUnicorn-master 我尝试使用以下命令使用但未成功:cordova插件添加/ Desktop / SuperUnicorn-master

You can check on phonegap build if the plugin doesn't already exist in a newer version https://build.phonegap.com/plugins (most of the plugins listed there are updated for phonegap 3) 您可以检查phonegap构建,如果新版本https://build.phonegap.com/plugins中不存在该插件(此处列出的大多数插件已针对phonegap 3更新)

Otherwise you will have to convert the plugin yourself. 否则,您将不得不自己转换插件。 For android it would be : 对于android将是:

  • convert the code from the 2.3 syntax to the 2.7+ syntax : http://simonmacdonald.blogspot.fr/2013/06/why-dont-my-plugins-work-in-phonegap.html 将代码从2.3语法转换为2.7+语法: http ://simonmacdonald.blogspot.fr/2013/06/why-dont-my-plugins-work-in-phonegap.html
  • add the files manually in platforms/android/... if you do not want to use the CLI 如果您不想使用CLI,请手动在platform / android / ...中添加文件
  • or create a plugin.xml to be able to install the plugin using the CLI. 或创建plugin.xml以便能够使用CLI安装插件。 For that I suggest you read the Phonegap plugin specification and then have a look at existing plugins to have different samples. 为此,我建议您阅读Phonegap插件规范 ,然后查看现有的插件以使用不同的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM