科尔多瓦不可用
cordova is not available
我正在尝试使用 @ionic-native/file-opener 打开 ionic 中的 PDF 文件并遇到 cordova 问题。
Native: tried calling FileOpener.open, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
我该如何解决?
使 cordova 可用的唯一方法是 运行 平台浏览器。
$ ionic cordova run browser
您运行正在使用浏览器或模拟器吗?您可以在模拟器中使用 Ionic CLI 运行,如下所示:
ionic cordova run android
如果您设置了 Cordova and the Android SDK,它应该会启动模拟器。
正在复制 @AjayGupta's answer from this 线程:
If you want the plugin to work for the browser you should add platform browser and run it:
ionic cordova platform add browser
and run it:
ionic cordova run browser
instead of ionic serve
.
我正在尝试使用 @ionic-native/file-opener 打开 ionic 中的 PDF 文件并遇到 cordova 问题。
Native: tried calling FileOpener.open, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
我该如何解决?
使 cordova 可用的唯一方法是 运行 平台浏览器。
$ ionic cordova run browser
您运行正在使用浏览器或模拟器吗?您可以在模拟器中使用 Ionic CLI 运行,如下所示:
ionic cordova run android
如果您设置了 Cordova and the Android SDK,它应该会启动模拟器。
正在复制 @AjayGupta's answer from this 线程:
If you want the plugin to work for the browser you should add platform browser and run it:
ionic cordova platform add browser
and run it:
ionic cordova run browser
instead ofionic serve
.