I've successfully built an iOS version of my app and I'm now trying to add Android. However, when I do a ionic platform add android
one of the plugins (cordova-plugin-geolocation) fails with the following error:
Failed to install 'cordova-plugin-geolocation':CordovaError: Plugin doesn't support this project's cordova-android version. cordova-android: 4.0.2, failed version requirement: >=5.0.0-dev
I thought I was running the latest version of Cordova so I double checkionic info
which returns this:
Cordova CLI: 5.1.1
Gulp version: CLI version 3.8.11
Gulp local: Local version 3.8.11
Ionic Version: 1.1.1
Ionic CLI Version: 1.7.10
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.5.0
ios-sim version: 3.1.1
OS: Mac OS X El Capitan
Node Version: v0.12.2
Xcode version: Xcode 7.1.1 Build version 7B1005
So, perhaps the project isn't up to date? I run:cordova -v
which returns:$ 5.1.1
OK something's odd so I'll just try to update the project by running:cordova platform update android
which outputs this:
Updating android project...
Android project updated with cordova-android@4.0.2
...
So, I've tried removing/adding the platform:ionic platform rm android
followed byionic platform add android
which oddly includes this snippet:
$ ionic platform add android
Updated the hooks directory to have execute permissions
Running command: /Volumes/Data/Documents/development/cordova/xxxx/hooks/before_platform_add/init_directories.js /Volumes/Data/Documents/development/cordova/xxxx
npm http GET https://registry.npmjs.org/cordova-android
npm http 304 https://registry.npmjs.org/cordova-android
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.xxxx
Name: xxxx
Activity: MainActivity
Android target: android-22
Copying template files...
Android project created with cordova-android@4.0.2
So 3 questions:
- Why is it suddenly referring to an old version of cordova (I've tried to find references to 4.0.2 in config.xml etc but no luck - any ideas welcome!)?
- What command do I need to run to see what version of cordova-android this particular project is using?
- What do I need to do to update the version of cordova-android used in this project?
Thanks,
James