I have written a simple Cordova plugin (for iOS) and every time I update the plugin (which is in a separate git repo), I remove the plugin and add it back to my Cordova project.
Recently, I discovered that my plugin source code files (.m files) do not get added to the list of Compile Sources (under build phase) and every time I do this, I have to open Xcode and add the files manually.
I didn't think that's the way it works. Is it? Or am I doing something wrong? Issue with "cordova add plugin"?
I don't pass the git repo URL to cordova, I just use ../plugin-dir. Like this:
$ cd myAppProject
$ cordova plugin remove com.example.myplugin
$ cordova plugin add ../MyPlugin
$ cordova plugin list
[ 'com.example.myplugin',
'org.apache.cordova.camera',
'org.apache.cordova.console',
'org.apache.cordova.device',
'org.apache.cordova.geolocation' ]
Your help is appreciated.
UPDATE: I created a fresh project and added and removed my plugin a few times and the Xcode project build settings file (project.pbxproj) is updated correctly. So there must be some issue with my other project.
Any time you run cordova plugin add XXXX
you have to run cordova prepare
or cordova build
for the files to placed in the platform projects.
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