Adding plugins breaks build


I’ve read others posts and people are having similar issues after adding plugins using

cordova add plugin [plugin_name]

The error is happens when you do

cordova add plugin [plugin_name]

and then

ionic build ios

I realized thhe plugins aren’t being copied into the following directory:


I solve this by copying just the necessary *.h and *.m files with the corresponding folder name.

Is this a cordova or ionic thing?

Similar issue: Cordova splashscreen plugin breaks ios build


As a beginner in ionic / Cordova, I had the same problem. It seems that when you add a plugin, it need to be installed in the platform also.
I solved it to remove platform and add it again.

ionic platform rm ios
Ionic platform add ios

but it creates other problems, losing customized icons and splash screens in the platform.
One can consider using hooks

If there is a better way, please let me know



I had the same problem with the SplashScreen plugin and solved by removing the Plugin’s files in Xcode, then re-adding the plugin via cordova plugin add.
This way I hadn’t to remove and add again the platform, keeping icons and splash screens.



I solved the problem of icons and splashes by created a shell script that sets up my project and makes sure that all the plugins and OSs are installed, then it add the icons and splashes to the correct places before running

cordova build

So now I just run and it sets up everything and builds for me. My boss is a big fan of being able to do a pull, run one script and have everything working. It is a nice practice to follow


@meiding sounds awesome. Could you share this script?


Here is the script setupCordovaProject:

and this is buildCordova:

Build cordova calls setup and then for us it applies a patch for an iOS problem we had. If anyone has any other ideas for this please feel free to share


Just wanted to add that this did the trick for me. Fortunately, we had not added icons and splash screens yet.