Hi all.
I’m not sure what’s going on here… but I continue to get errors when building and adding platform. I’m on latest version of ionic and have tried downgrading too.
This is the error:
Failed to restore plugin “cordova-plugin-media-capture” from config.xml. You might need to try adding it again. Error: Version of installed plugin: “[email protected]” does not satisfy dependency plugin requirement “cordova-plugin-file@^4.0.0”. Try --force to use installed plugin as dependency.
In my config.xml and package.json I have these dependencies:
And a bunch of other dependencies that also have dependencies for this. However, when the script comes to install cordova-plugin-file plugin, it grabs version 5.0.0. This isn’t compatible with another plugin I’m using so it throws an error - but why is it fetching version 5.0.0 if I’ve explicitly set 4.3.3?
Another plugin has a dependency for cordova-plugin-file, such as this one:
So my guess is that it’s finding this plugin first, and installing the latest version of cordova-plugin-file - and then fails when it gets to another plugin that is dependant on an earlier version… however, moving the cordova-plugin-file dependency to the top of the config.xml doesn’t seem to help.
Does anyone have any suggestions?
Many thanks!
Sure.
Also worth noting the same config.xml is working on a colleagues machine… same npm, ionic and cordova version though.
Thanks.
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.test.app" version="1.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>App Name</name>
<description>Desc.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Dev Team</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
<icon height="114" src="resources/ios/icon/[email protected]" width="114" />
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
<icon height="80" src="resources/ios/icon/[email protected]" width="80" />
<icon height="120" src="resources/ios/icon/[email protected]" width="120" />
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
<icon height="100" src="resources/ios/icon/[email protected]" width="100" />
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
<icon height="120" src="resources/ios/icon/[email protected]" width="120" />
<icon height="180" src="resources/ios/icon/[email protected]" width="180" />
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
<icon height="144" src="resources/ios/icon/[email protected]" width="144" />
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
<icon height="152" src="resources/ios/icon/[email protected]" width="152" />
<icon height="167" src="resources/ios/icon/[email protected]" width="167" />
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
<icon height="58" src="resources/ios/icon/[email protected]" width="58" />
<icon height="87" src="resources/ios/icon/[email protected]" width="87" />
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
<splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
<icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
</platform>
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashScreenDelay" value="18000" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value="500" />
<preference name="SplashScreenBackgroundColor" value="0x193654FF" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#000000" />
<preference name="StatusBarStyle" value="lightcontent" />
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
<preference name="loadUrlTimeoutValue" value="700000" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<icon src="resources/android/icon/drawable-xhdpi-icon.png" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<engine name="android" spec="^6.4.0" />
<engine name="ios" spec="^4.5.4" />
<plugin name="com-sarriaroman-photoviewer" spec="^1.1.11" />
<plugin name="com.synconset.imagepicker" spec="^2.1.10">
<variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="your usage message" />
</plugin>
<plugin name="cordova-plugin-advanced-http" spec="^1.8.1" />
<plugin name="cordova-plugin-android-permissions" spec="^1.0.0" />
<plugin name="cordova-plugin-camera" spec="^2.4.1">
<variable name="CAMERA_USAGE_DESCRIPTION" value=" " />
<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value=" " />
</plugin>
<plugin name="cordova-plugin-compat" spec="^1.2.0" />
<plugin name="cordova-plugin-console" spec="^1.1.0" />
<plugin name="cordova-plugin-device" spec="^1.1.7" />
<plugin name="cordova-plugin-fcm" spec="^2.1.2" />
<plugin name="cordova-plugin-file" spec="^4.3.3" />
<plugin name="cordova-plugin-file-transfer" spec="^1.6.3" />
<plugin name="cordova-plugin-filechooser" spec="^1.0.1" />
<plugin name="cordova-plugin-filepath" spec="^1.1.0" />
<plugin name="cordova-plugin-http" spec="^1.2.0" />
<plugin name="cordova-plugin-inappbrowser" spec="^1.7.2" />
<plugin name="cordova-plugin-media-capture" spec="^1.4.3">
<variable name="CAMERA_USAGE_DESCRIPTION" value=" " />
<variable name="MICROPHONE_USAGE_DESCRIPTION" value=" " />
<variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value=" " />
</plugin>
<plugin name="cordova-plugin-nativestorage" spec="^2.2.2" />
<plugin name="cordova-plugin-network-information" spec="^1.3.4" />
<plugin name="cordova-plugin-splashscreen" spec="^4.1.0" />
<plugin name="cordova-plugin-statusbar" spec="^2.3.0" />
<plugin name="cordova-plugin-themeablebrowser" spec="^0.2.17" />
<plugin name="cordova-plugin-videoplayer" spec="^0.1.4" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-zip" spec="^3.1.0" />
<plugin name="cordova-sqlite-storage" spec="^2.1.2" />
<plugin name="cordova.plugins.diagnostic" spec="^3.7.1" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
</widget>
cli packages: (/Users/user/code/apps/test/node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
@ionic/app-scripts : 1.3.7
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.2.1
System:
Android SDK Tools : 26.1.1
Node : v8.8.1
npm : 4.6.1
OS : macOS Sierra
Xcode : Xcode 9.1 Build version 9B55
Environment Variables:
ANDROID_HOME : /Users/user/Library/Android/sdk
Misc:
backend : legacy
Ok, thanks. So I’ve completely reinstalled node/npm, and ionic and updated app-scripts etc. Now this is my ionic info and the same issue is happening:
Thanks again.
cli packages: (/Users/user/code/apps/test/node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.2
Cordova Platforms : android 6.4.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v9.2.0
npm : 5.5.1
OS : macOS Sierra
Xcode : Xcode 9.1 Build version 9B55
Environment Variables:
ANDROID_HOME : /Users/user/Library/Android/sdk
Misc:
backend : legacy
The full output from adding platform:
$ ionic cordova platform add android@latest
> cordova platform add android@latest --save
Using cordova-fetch for cordova-android@latest
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.test.app
Name: App_Name
Activity: MainActivity
Android target: android-26
Subproject Path: CordovaLib
Android project created with [email protected]
Discovered plugin "com-sarriaroman-photoviewer" in config.xml. Adding it to the project
Installing "com-sarriaroman-photoviewer" for android
Subproject Path: CordovaLib
Adding com-sarriaroman-photoviewer to package.json
Saved plugin info for "com-sarriaroman-photoviewer" to config.xml
Discovered plugin "com.synconset.imagepicker" in config.xml. Adding it to the project
Installing "com.synconset.imagepicker" for android
Subproject Path: CordovaLib
Adding com.synconset.imagepicker to package.json
Saved plugin info for "com.synconset.imagepicker" to config.xml
Discovered plugin "cordova-plugin-advanced-http" in config.xml. Adding it to the project
Installing "cordova-plugin-advanced-http" for android
Installing "cordova-plugin-file" for android
The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.
If this is a new application no changes are required.
If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:
"<preference name="AndroidPersistentFileLocation" value="Compatibility" />"
to config.xml in order for the application to find previously stored files.
Adding cordova-plugin-advanced-http to package.json
Saved plugin info for "cordova-plugin-advanced-http" to config.xml
Discovered plugin "cordova-plugin-android-permissions" in config.xml. Adding it to the project
Installing "cordova-plugin-android-permissions" for android
Adding cordova-plugin-android-permissions to package.json
Saved plugin info for "cordova-plugin-android-permissions" to config.xml
Discovered plugin "cordova-plugin-camera" in config.xml. Adding it to the project
Installing "cordova-plugin-camera" for android
Installing "cordova-plugin-compat" for android
Plugin doesn't support this project's cordova-android version. cordova-android: 6.4.0, failed version requirement:
<6.3.0
Skipping 'cordova-plugin-compat' for android
Subproject Path: CordovaLib
Adding cordova-plugin-camera to package.json
Saved plugin info for "cordova-plugin-camera" to config.xml
Discovered plugin "cordova-plugin-console" in config.xml. Adding it to the project
Installing "cordova-plugin-console" for android
Adding cordova-plugin-console to package.json
Saved plugin info for "cordova-plugin-console" to config.xml
Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
Installing "cordova-plugin-device" for android
Adding cordova-plugin-device to package.json
Saved plugin info for "cordova-plugin-device" to config.xml
Discovered plugin "cordova-plugin-fcm" in config.xml. Adding it to the project
Installing "cordova-plugin-fcm" for android
Subproject Path: CordovaLib
Cordova FCM plugin v2.1.2 installed
For more details visit https://github.com/fechanique/cordova-plugin-fcm
Adding cordova-plugin-fcm to package.json
Saved plugin info for "cordova-plugin-fcm" to config.xml
Discovered plugin "cordova-plugin-file-transfer" in config.xml. Adding it to the project
Installing "cordova-plugin-file-transfer" for android
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Adding cordova-plugin-file-transfer to package.json
Saved plugin info for "cordova-plugin-file-transfer" to config.xml
Discovered plugin "cordova-plugin-filechooser" in config.xml. Adding it to the project
Installing "cordova-plugin-filechooser" for android
Adding cordova-plugin-filechooser to package.json
Saved plugin info for "cordova-plugin-filechooser" to config.xml
Discovered plugin "cordova-plugin-filepath" in config.xml. Adding it to the project
Installing "cordova-plugin-filepath" for android
Subproject Path: CordovaLib
Adding cordova-plugin-filepath to package.json
Saved plugin info for "cordova-plugin-filepath" to config.xml
Discovered plugin "cordova-plugin-http" in config.xml. Adding it to the project
Installing "cordova-plugin-http" for android
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-http': CordovaError: Uh oh!
"/Users/user/code/apps/test/platforms/android/src/com/github/kevinsawicki/http/HttpRequest.java" already exists!
at copyNewFile (/Users/user/code/apps/test/platforms/android/cordova/lib/pluginHandlers.js:245:45)
at install (/Users/user/code/apps/test/platforms/android/cordova/lib/pluginHandlers.js:43:17)
at ActionStack.process (/Users/user/code/apps/test/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
at PluginManager.doOperation (/Users/user/code/apps/test/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:114:20)
at PluginManager.addPlugin (/Users/user/code/apps/test/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:144:17)
at /Users/user/code/apps/test/platforms/android/cordova/Api.js:243:74
at _fulfilled (/Users/user/code/apps/test/platforms/android/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (/Users/user/code/apps/test/platforms/android/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (/Users/user/code/apps/test/platforms/android/cordova/node_modules/q/q.js:816:13)
at /Users/user/code/apps/test/platforms/android/cordova/node_modules/q/q.js:570:49
Failed to restore plugin "cordova-plugin-http" from config.xml. You might need to try adding it again. Error: Uh oh!
"/Users/user/code/apps/test/platforms/android/src/com/github/kevinsawicki/http/HttpRequest.java" already exists!
Discovered plugin "cordova-plugin-inappbrowser" in config.xml. Adding it to the project
Installing "cordova-plugin-inappbrowser" for android
Adding cordova-plugin-inappbrowser to package.json
Saved plugin info for "cordova-plugin-inappbrowser" to config.xml
Discovered plugin "cordova-plugin-media-capture" in config.xml. Adding it to the project
Installing "cordova-plugin-media-capture" for android
Failed to install 'cordova-plugin-media-capture': CordovaError: Version of installed plugin: "[email protected]" does not satisfy dependency plugin requirement "cordova-plugin-file@^4.0.0". Try --force to use installed plugin as dependency.
at /Users/user/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:557:37
at _fulfilled (/Users/user/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/Users/user/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/Users/user/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /Users/user/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/q/q.js:509:49
at flush (/Users/user/.nvm/versions/node/v9.2.0/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
Failed to restore plugin "cordova-plugin-media-capture" from config.xml. You might need to try adding it again. Error: Version of installed plugin: "[email protected]" does not satisfy dependency plugin requirement "cordova-plugin-file@^4.0.0". Try --force to use installed plugin as dependency.
Discovered plugin "cordova-plugin-nativestorage" in config.xml. Adding it to the project
Installing "cordova-plugin-nativestorage" for android
Adding cordova-plugin-nativestorage to package.json
Saved plugin info for "cordova-plugin-nativestorage" to config.xml
Discovered plugin "cordova-plugin-network-information" in config.xml. Adding it to the project
Installing "cordova-plugin-network-information" for android
Adding cordova-plugin-network-information to package.json
Saved plugin info for "cordova-plugin-network-information" to config.xml
Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
Installing "cordova-plugin-splashscreen" for android
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for "cordova-plugin-splashscreen" to config.xml
Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
Installing "cordova-plugin-statusbar" for android
Adding cordova-plugin-statusbar to package.json
Saved plugin info for "cordova-plugin-statusbar" to config.xml
Discovered plugin "cordova-plugin-themeablebrowser" in config.xml. Adding it to the project
Installing "cordova-plugin-themeablebrowser" for android
Adding cordova-plugin-themeablebrowser to package.json
Saved plugin info for "cordova-plugin-themeablebrowser" to config.xml
Discovered plugin "cordova-plugin-videoplayer" in config.xml. Adding it to the project
Installing "cordova-plugin-videoplayer" for android
Adding cordova-plugin-videoplayer to package.json
Saved plugin info for "cordova-plugin-videoplayer" to config.xml
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Discovered plugin "cordova-plugin-zip" in config.xml. Adding it to the project
Installing "cordova-plugin-zip" for android
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Adding cordova-plugin-zip to package.json
Saved plugin info for "cordova-plugin-zip" to config.xml
Discovered plugin "cordova-sqlite-storage" in config.xml. Adding it to the project
Installing "cordova-sqlite-storage" for android
installing external dependencies via npm
npm install of external dependencies ok
Adding cordova-sqlite-storage to package.json
Saved plugin info for "cordova-sqlite-storage" to config.xml
Discovered plugin "cordova.plugins.diagnostic" in config.xml. Adding it to the project
Installing "cordova.plugins.diagnostic" for android
Subproject Path: CordovaLib
Adding cordova.plugins.diagnostic to package.json
Saved plugin info for "cordova.plugins.diagnostic" to config.xml
Discovered plugin "ionic-plugin-keyboard" in config.xml. Adding it to the project
Installing "ionic-plugin-keyboard" for android
Adding ionic-plugin-keyboard to package.json
Saved plugin info for "ionic-plugin-keyboard" to config.xml
--save flag or autosave detected
Saving android@latest into config.xml file ...
samellis:
Discovered plugin “cordova-plugin-file-transfer” in config.xml. Adding it to the project
Installing “cordova-plugin-file-transfer” for android
Plugin dependency “cordova-plugin-file@5.0.0” already fetched, using that version.
Dependent plugin “cordova-plugin-file” already installed on android.
Adding cordova-plugin-file-transfer to package.json
samellis:
Discovered plugin “cordova-plugin-http” in config.xml. Adding it to the project
Installing “cordova-plugin-http” for android
Plugin dependency “[email protected]” already fetched, using that version.
Dependent plugin “cordova-plugin-file” already installed on android.
Error during processing of action! Attempting to revert…
Failed to install ‘cordova-plugin-http’: CordovaError: Uh oh!
“/Users/user/code/apps/test/platforms/android/src/com/github/kevinsawicki/http/HttpRequest.java” already exists!
at copyNewFile (/Users/user/code/apps/test/platforms/android/cordova/lib/pluginHandlers.js:245:45)
at install (/Users/user/code/apps/test/platforms/android/cordova/lib/pluginHandlers.js:43:17)
This is where stuff starts going wrong, right?
Can you recreate this with a plain Cordova project?
Adding these 3 plugins should be enough to recreate the problem, right?
Would make understanding the problem much easier - and also allow you to post the problem at issues.cordova.io.