简体   繁体   English

在Cordova CLI中使用插件

[英]Using plugins with Cordova CLI

I'm using Cordova CLI (v6.0.0) to make an app for Android and I can't load the plugins: cordova-plugin-file and cordova-plugin-dialogs. 我正在使用Cordova CLI(v6.0.0)为Android制作应用程序,我无法加载插件:cordova-plugin-file和cordova-plugin-dialogs。 I know it because the next alerts are shown: 我知道它,因为显示下一个警报:

if (!navigator.notification)
    alert("Plugin notification not working properly!");

if (!window.requestFileSystem)
    alert("Plugin file not working properly!");

Plugins are used after clicking a button (not before ondeviceready event). 单击按钮后(而不是ondeviceready事件之前)使用插件。 Plugins have been installed with: 已安装插件:

cordova-plugin-file v.1.2.0 cordova-plugin-file v.1.2.0

 cordova plugin add cordova-plugin-file 

cordova-plugin-dialogs v4.1.0 cordova-plugin-dialogs v4.1.0

 cordova plugin add cordova-plugin-dialogs

I've also added the next line in config.xml 我还在config.xml中添加了下一行

<preference name="AndroidPersistentFileLocation" value="Compatibility" />

What I'm doing wrong? 我做错了什么?

主html文件中的下一行丢失了:

<script type="text/javascript" src="cordova.js"></script>

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

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