0

Failed to restore plugin "cordova-plugin-file-transfer" from config.xml. You might need to try adding it again. Error: Version of installed plugin: "cordova-plugin-file@4.3.3" does not satisfy dependency plugin requirement "cordova-plugin-file@^5.0.0". Try --force to use installed plugin as dependency.

I am facing above issue while running

ionic cordova run android

on mac. not sure why its giving this issue. I am using android 6.4.0.

Paul Floyd
  • 5,530
  • 5
  • 29
  • 43
Anil Kumar
  • 701
  • 11
  • 28

1 Answers1

1

TL;DR: run these commands:

ionic cordova plugin rm cordova-plugin-file --force
ionic cordova plugin add cordova-plugin-file@latest
ionic cordova run android

When you run ionic cordova run android, the Cordova CLI is running a prepare operation which tries to restore any plugins which are present in your config.xml/package.json but not installed in you local project.

So it's trying to install a recent version of cordova-plugin-file-transfer but this is failing because you have v4.3.3 of cordova-plugin-file installed in plugins/ and cordova-plugin-file-transfer now requires v5.0.0+

DaveAlden
  • 30,083
  • 11
  • 93
  • 155
  • Thanks @DaveAlden above issue is resolved. but now facing issue like Error: Requirements check failed for JDK 1.8 or greater and i have java version java version "9.0.1" Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode) – Anil Kumar Nov 15 '17 at 09:21
  • That's because [Android and therefore Cordova doesn't support Java 9 yet](https://issues.apache.org/jira/browse/CB-11343). Potential solution [here](https://stackoverflow.com/q/46807676/777265). – DaveAlden Nov 15 '17 at 09:26