2
votes

IOS build failed with following error

Failed to install "cordova-plugin-photo-library":"CordovaError: Version of installed plugin:"[email protected]" does not satisfy dependency plugin requirement "cordova-plugin-file@^4.3.2'. Try --force to use installed plugin as dependency .

Cli packages ionic/cli-utils:1.19.1 ionic (ionic CLI): 3.19.1

Global Packages: cordova (Cordova CLI) : 8.0.0

Local Packages:

ionic/app-scripts: 3.1.6 Cordova Platforms : ios 4.5.4

DEPENDECIES

cordova-plugin-add-swift-support: 1.7.1 cordova-plugin-camera: 3.0.0 cordova-plugin-file: 6.0.1

Tried forcing ( [email protected]), got next error Cannot find module'../cordova/platform_metadata'

Thanks

5

5 Answers

1
votes

I found the solution from https://github.com/terikon/cordova-plugin-photo-library/issues/107#issuecomment-367320068 I updated plugin.xml with <dependency id="cordova-plugin-file" version="6.0.1"/> to fix this issue

1
votes

I got this issue because I used plugin "cordova-plugin-file-transfer", so both of them use cordova-plugin-file => conflict. I solve it by those steps below:
1. Remove plugin "cordova-plugin-file-transfer":

ionic cordova plugin rm cordova-plugin-file-transfer

2. Add plugin "cordova-plugin-photo-library"

ionic cordova plugin  add cordova-plugin-photo-library

3. Re-add plugin "cordova-plugin-file-transfer":

ionic cordova plugin add cordova-plugin-file-transfer

and run ionic cordova prepare to build sources.

0
votes

I had this same problem with the File plugin. I had to match the version in plugin.xml (cordova-plugin-file) with the latest version. You will also need to review project.properties and build.gradle

0
votes

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cannot find module '../cordova/platform_metadata' error.

It was a bug in in cordova-plugin-add-swift-support, you just need to update it to its latest version

cordova plugin rm cordova-plugin-add-swift-support

cordova plugin add cordova-plugin-add-swift-support

Reference: https://github.com/terikon/cordova-plugin-photo-library/issues/111