在Cordova CLI中使用插件

aci*_*tal 9 plugins android cordova

我正在使用Cordova CLI(v6.0.0)为Android制作应用程序,我无法加载插件:cordova-plugin-file和cordova-plugin-dialogs.我知道它,因为显示下一个警报:

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

if (!window.requestFileSystem)
    alert("Plugin file not working properly!");
Run Code Online (Sandbox Code Playgroud)

单击按钮后(而不是ondeviceready事件之前)使用插件.已安装插件:

cordova-plugin-file v.1.2.0

 cordova plugin add cordova-plugin-file 
Run Code Online (Sandbox Code Playgroud)

cordova-plugin-dialogs v4.1.0

 cordova plugin add cordova-plugin-dialogs
Run Code Online (Sandbox Code Playgroud)

我还在config.xml中添加了下一行

<preference name="AndroidPersistentFileLocation" value="Compatibility" />
Run Code Online (Sandbox Code Playgroud)

我做错了什么?

aci*_*tal 2

主 html 文件中缺少下一行:

<script type="text/javascript" src="cordova.js"></script>
Run Code Online (Sandbox Code Playgroud)