I have an ionic/cordova project using:
[email protected] [email protected] cordova cli 6.4.0 ionic 1.3.3
When I try to add the Android platform, I get the following output
================ $ ionic platform add [email protected] Adding android project... Creating Cordova project for the Android platform: Path: platforms/android Package: com.ionicframework.name Name: name Activity: MainActivity Android target: android-25 Subproject Path: CordovaLib Android project created with [email protected]
Error: cordovaProject.projectConfig.getFileResources is not a function
It seems this issue is related to a bug in [email protected], as confirmed here: https://issues.apache.org/jira/browse/CB-12633
I have now updated my system to cordova-cli - [email protected] and [email protected], and it seemed to work.
Update to version 6 of cordova cli with:
npm install -g cordova@6
And then add the correct version of cordova-android
cordova platform add android@6
Not directly related to this issue, but once I got it working, my system did complain about the gradle path not being set when I tried building my app, and so I followed the steps here: https://gradle.org/install#with-homebrew, and now all builds successfully.
update cordova
npm install -g cordova
and then try to add platform or if any problem with new version of cordova then use below
There is a problem with cordova version 6.4.0 and android 6.2.1. So, please try with below compatible versions
cordova version must be 6.4.0
npm install -g [email protected]
Install android in your project
cordova platform add [email protected]
or
ionic platform add [email protected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With