我正在使用离子和cordova制作应用程序。 我添加CameraPreview插件来使用它,但当我部署到ios并在iphone上测试时,它说
[警告] Native:尝试调用CameraPreview.startCamera,但未安装CameraPreview插件。 (vendor.js,第1行)
[警告]安装CameraPreview插件:'离子cordova插件添加cordova-plugin-camera-preview'(vendor.js,第1行)
但在我的pakage.json相机预览中
"dependencies": {
"@angular/common": "4.1.3",
"@angular/compiler": "4.1.3",
"@angular/compiler-cli": "4.1.3",
"@angular/core": "4.1.3",
"@angular/forms": "4.1.3",
"@angular/http": "4.1.3",
"@angular/platform-browser": "4.1.3",
"@angular/platform-browser-dynamic": "4.1.3",
"@ionic-native/camera-preview": "^4.2.1",
"@ionic-native/core": "3.12.1",
"@ionic-native/splash-screen": "3.12.1",
"@ionic-native/status-bar": "3.12.1",
"@ionic/storage": "2.0.1",
"cordova-android": "^6.2.3",
"cordova-browser": "^4.1.0",
"cordova-ios": "^4.4.0",
"cordova-plugin-camera-preview": "git+https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview.git",
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.2",
"cordova-plugin-whitelist": "^1.3.1",
"ionic-angular": "3.5.3",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"rxjs": "5.4.0",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.12"
},
首先,我打字
ionic cordova plugin add cordova-plugin-camera-preview
并解决问题,我将其删除并安装
ionic cordova plugin add https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview.git
但仍然无效。 我无法弄清楚问题。
这是我的信息 cli包:
@ionic/cli-utils : 1.6.0 (/Users/hbin/righthere/node_modules/ionic/node_modules/@ionic/cli-utils)
ionic (Ionic CLI) : 3.6.0 (/Users/hbin/righthere/node_modules/ionic)
全球套餐:
Cordova CLI : 7.0.1
本地包裹:
@ionic/app-scripts : 2.0.2
@ionic/cli-plugin-cordova : 1.4.1
@ionic/cli-plugin-ionic-angular : 1.3.2
Cordova Platforms : android 6.2.3 browser 4.1.0 ios 4.4.0
Ionic Framework : ionic-angular 3.5.3
系统:
Node : v8.1.3
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
ios-deploy : 1.9.1
npm : 5.0.3