Android build error upon upgrading Cordova camera plugin
最近Ionic2项目安装cordova-plugin-camera插件,一直报错。(已经Add了android的platform),大概的错误信息如下。
[ERROR] Cordova encountered an error. You may get more insight by running the Cordova command above directly. [ERROR] An error occurred while running cordova plugin add cordova-plugin-camera --save (exit code 1): Installing "cordova-plugin-camera" for android Failed to install 'cordova-plugin-camera': Error at D:\Program Files\nodejs\node_global\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:581:33 at _fulfilled (D:\Program Files\nodejs\node_global\node_modules\cordova\node_modules\q\q.js:787:54) at self.promiseDispatch.done (D:\Program Files\nodejs\node_global\node_modules\cordova\node_modules\q\q.js:816:30) at Promise.promise.promiseDispatch (D:\Program Files\nodejs\node_global\node_modules\cordova\node_modules\q\q.js:749:13) at D:\Program Files\nodejs\node_global\node_modules\cordova\node_modules\q\q.js:509:49 at flush (D:\Program Files\nodejs\node_global\node_modules\cordova\node_modules\q\q.js:108:17) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9) Error: Version of installed plugin: "[email protected]" does not satisfy dependency plugin requirement "cordova-plugin-compat@^1.1.0". Try --force to use installed plugin as dependency.
解决方案:
Here's the commands we ran from the CLI:
cordova plugin remove cordova-plugin-compat --force cordova plugin add [email protected]