访问cordova.js时出错 - " Cordova_Not_Available" (离子2)

时间:2017-01-30 05:11:14

标签: android cordova ionic-framework ionic2

我尝试使用原生相机模块拍照(在Android设备上正常工作),但在网络查看器上运行相同时出现以下错误(镀铬控制台)

plugin.js:33 Native: tried calling Camera.getPicture, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
cordovaWarn @ plugin.js:33
callCordovaPlugin @ plugin.js:112
(anonymous) @ plugin.js:159
(anonymous) @ plugin.js:131
t @ polyfills.js:3
tryNativePromise @ plugin.js:130
getPromise @ plugin.js:152
wrapPromise @ plugin.js:158
(anonymous) @ plugin.js:325
value @ plugin.js:386
TabsPage.takePhoto @ tabs.ts:36
TabsPage.shootMessage @ tabs.ts:29
View_TabsPage0.handleEvent_5 @ component.ngfactory.js:124
(anonymous) @ view.js:408
schedulerFn @ async.js:94
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:74
Tabs.select @ tabs.js:327
View_Tabs1.handleEvent_0 @ component.ngfactory.js:212
(anonymous) @ view.js:408
schedulerFn @ async.js:94
SafeSubscriber.__tryOrUnsub @ Subscriber.js:223
SafeSubscriber.next @ Subscriber.js:172
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:74
TabButton.onClick @ tab-button.js:30
Wrapper_TabButton.handleEvent @ wrapper.ngfactory.js:99
View_Tabs1.handleEvent_0 @ component.ngfactory.js:210
(anonymous) @ view.js:408
(anonymous) @ dom_renderer.js:276
t.invokeTask @ polyfills.js:3
onInvokeTask @ ng_zone.js:227
t.invokeTask @ polyfills.js:3
e.runTask @ polyfills.js:3
invoke @ polyfills.js:3
**tabs.ts:45 cordova_not_available**

已经尝试过了

我还可以看到该文件存在于多个位置的文件夹中,但不知何故它无法访问。

enter image description here

离子信息

Your system information:

Cordova CLI: 6.5.0 
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.9.4
Xcode version: Not installed

0 个答案:

没有答案