Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Cordova (3.4) doesn't add plugin source to project compile list

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.

like image 979
raminr Avatar asked Oct 20 '22 12:10

raminr


1 Answers

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.

like image 70
Dawson Loudon Avatar answered Oct 23 '22 21:10

Dawson Loudon