使用插件与Cordova CLI

9

我正在使用 Cordova CLI(版本为 6.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!");

插件是在点击按钮后使用的(而不是在 ondeviceready 事件之前)。

插件已经安装:

cordova-plugin-file v.1.2.0

 cordova plugin add cordova-plugin-file 

cordova-plugin-dialogs v4.1.0

 cordova plugin add cordova-plugin-dialogs

我已经在config.xml中添加了下一行。
<preference name="AndroidPersistentFileLocation" value="Compatibility" />

我做错了什么?

你应该安装插件的直接Git链接,这样更好。 - Jay Rathod
但问题仍然存在... - acimutal
дҪ еңЁзӯүеҫ…cordovaзҡ„devicereadyдәӢ件еҗ—пјҹж–ҮжЎЈй“ҫжҺҘ - Beat
我不会在应用程序开始时使用插件,而是当我点击一个按钮时。 - acimutal
有其他建议吗? - acimutal
1个回答

2
下一行在主HTML文件中缺失:
<script type="text/javascript" src="cordova.js"></script>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接