简体   繁体   English

Cordova插件安装无法正常工作

[英]Cordova plugin installation is not working

I'm trying to install this plugin: 我正在尝试安装此插件:

https://github.com/wnyc/cordova-plugin-playerhater https://github.com/wnyc/cordova-plugin-playerhater

So I execute this command 所以我执行这个命令

cordova plugin add https://github.com/wnyc/cordova-plugin-playerhater.git

And add this to config.xml 并将其添加到config.xml

<gap:plugin name="org.nypr.cordova.playerhaterplugin" version="0.1.0" />

After that I try: 之后,我尝试:

alert(window.audioplayer); //undefined
alert(window.cordova.plugins); //{"fileextras":{}, "barcodeScanner":{...}}
alert(window.cordova.plugins.audioplayer); //undefined

How do I make this plugin work ? 如何使该插件正常工作?

Firstly the command is : 首先,命令是:

cordova local plugin add https://github.com/wnyc/cordova-plugin-playerhater.git

hence it didnt added pulgin properly , i would suggest you to do follow thing to install pulgin and do not add any code in config.xml manually . 因此它没有正确地添加pulgin,我建议你遵循的方法安装pulgin,不要在config.xml中手动添加任何代码。

  1. Download this plugin zip from here 此处下载此插件zip
  2. run command as : cordova plugin add [path of the extracted folder on ur local machine] 运行命令为:cordova插件添加[本地计算机上提取的文件夹的路径]
  3. Now check you plugin folder and cordova-pulgin.xml the pulgin would be added properly 现在检查您的插件文件夹和cordova-pulgin.xml,pulgin将被正确添加

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

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