How to add "cordova-plugin-file, ver 2.0.0" to my meteor project, notice: it is not "org.apache.cordova.file"

hi guys,

i need help.
i want to add “cordova-plugin-file, ver 2.0.0” to my meteor project,
using:

meteor add cordova:cordova-plugin-file@https://github.com/apache/cordova-plugin-file/tarball/91338732828976aec62bdddce2dada895e092d9d

but when “meteor run android-device”, it shows error:


mbp13:filesystem1 dyh$ meteor run android-devic
Error while running for mobile platforms: Error running                            
/Users/dyh/.meteor/packages/meteor-tool/.1.1.3.w1jfe8++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/cordova-scripts/cordova.sh
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-file':Error: Uh oh!

"/Users/dyh/filesystem1/.meteor/local/cordova-build/platforms/android/src/org/apache/cordova/file/EncodingException.java"
already exists!
at Object.module.exports.common.copyNewFile
.........
......

the cause of the things: i met a bug with org.apache.cordova.file@1.3.3 : https://issues.apache.org/jira/browse/CB-6428
then i have to use a higher version “cordova-plugin-file@2.0.0”.

i tried to follow “https://github.com/meteor/meteor/wiki/Meteor-Cordova-Phonegap-integration”,
but it does not work.

meteor add cordova:cordova-plugin-file@https://github.com/apache/cordova-plugin-file/tarball/91338732828976aec62bdddce2dada895e092d9d

i guess maybe meteor does not support “cordova-plugin-*” format.

there is an old news at April 21, 2015: All of our core plugins(means Cordova plugins) have changed their IDs from org.apache.cordova.* to cordova-plugin-*

url: http://cordova.apache.org/announcements/2015/04/21/plugins-release-and-move-to-npm.html

What should I do?

:smile:

Currently meteor uses Cordova 4.2.0 which currently uses the old org.apache plugins. I recently submitted a PR to the meteor repo to get Cordova 5 integrated and it has been accepted and merged into devel. I suspect it will be a part of the next release.

Glad to hear it! thank you!

You are very welcome.

Adding thanks - saved me hours of frustration… although I now have months of frustration whilst I am unable to install the current versions of plugins :slight_smile:

I am still unable to add cordova-plugin-file. Should I change the version or upgrade meteor?

Same problem here. I was struggling to install a cordova plugin. I’m running the most recent version of Meteor.

I tried:

meteor add cordova:org.apache.cordova.media-capture@1.0.1

and the command did execute successfully.

but then when i restart my meteor application, I get this error

Error: version not found: org.apache.cordova.media-capture@1.0.1

The fix for me was to do

cordova:org.apache.cordova.media-capture  0.3.6

To install the old version from February 2015. Then I am able to run

meteor run ios

And the application boots.

I am still pretty confused. As far as I can tell what is going on is that Meteor may not be compatible with the 1.0.1 version, but reports the error as “version not found”, which may not be the right error message.

The issue is that the current release version of Meteor includes an older version of Cordova that does not support downloading plugins from npm yet. Unfortunately, 0.3.6 is the latest version found in the old Cordova plugin registry.

I’ve been working on improvements to our Cordova integration for the Meteor 1.2 release. Among other things, this upgrades Cordova to the latest versions and takes care of converting the plugin IDs to the new format for you.

2 Likes

What worked for me was:-
In Meteor project folder .meteor create a file cordova-plugins and insert the line cordova-plugin-device@1.1.1… meteor will rebuild with the latest version

“cordova-plugin-device@1.1.1” will be whatever plugin@version