Third Party Plugins Don't Install Correctly (Fails on Build)

I have tried installing the following two cordova plugins:


and keep getting missing files errors, so I have a feeling it isnt installing correctly. When I dont use ionic, it installs fine (creating new cordova project, install plugin from cmd, build ios). When I use ionic, it always gives me a file missing error for these two plugins. I can eventually get it working, but need to know why this is happening because you shouldnt have to copy files around for plugins. Here are my steps that are not working:

ionic start test123 blank
cd test123
ionic platform add ios
ionic plugin add https://github.com/christocracy/cordova-plugin-background-geolocation
ionic build ios

… then I get this error while building (and build fails obviously)

Like I said, if I do it all through cordova cmd, it works fine.

/peerio-mobile/platforms/ios/peerio-mobile/Plugins/org.apache.cordova.geolocation/CDVLocation.m -o       /Users/timgiblin/Dropbox/Code/tg/peerio-mobile/platforms/ios/build/peerio-mobile.build/Debug-iphonesimulator/peerio-mobile.build/Objects-normal/i386/CDVLocation.o
clang: error: no such file or directory: '/Users/timgiblin/Dropbox/Code/tg/peerio-mobile/platforms/ios/peerio-mobile/Plugins/org.apache.cordova.geolocation/CDVLocation.m'
clang: error: no input files
1 Like

I get the same error.
I remove the Plugin:
cordova plugin remove org.apache.cordova.geolocation
->build ok
I add the plugin with cordova plugin add org.apache.cordova.geolocation
->build error

You need this steps to solved this Problem:

  • Open your project in Xcode.
  • Click on your project.
  • Click on your project under Targets.
  • Hit the build phases tab.
  • Open “Copy Bundle Resources” near the bottom.
  • Look for any resources listed in red, and drag/drop them manually there.

I found the files under:

  • Download the files and drag it into Xcode or paste the files into the needed location:
    projektname/platforms/ios/Appname/Plugins/org.apache.cordova.geolocation

  • close XCode

  • do: ionic build ios

  • start XCode and run your app

It works for me!!

1 Like

Yes I ran into this same problem and it took some time to figure out the solution. After adding the inappbrowser plugin, the IOS app would fail to build. The Android app was fine. I finally found the solution when I read this bug in Cordova which appears to be resolved. https://issues.apache.org/jira/browse/CB-4971

The issue is that when installing a plugin, the files do not get copied over to the ios platform. Based on something I read in that link, if you have already built the ios app and then add any plugins, any subsequent builds will fail.

The way I solved it was I removed the ios platform, I cannot recall exact syntax but I believe it was ionic platform remove ios. Then I add the ios platforn again, add the plugin, then build. Had no issues after that. Ofcourse if I add another plugin I will probably run into the issue again and would need to repeat these steps.

5 Likes

you might not need to remove the plugins just remove the platform “ionic platform rm ios” then add it back “ionic platform add ios”.

2 Likes

Thanks, override

I can confirm that running the following worked for me

$ ionic platform rm ios
$ ionic platform add ios

I wan’t able to set the Objective-C Bridging Header, and no plugins were present in my [project].xcodeproj/Plugins folder.

The add ios took a bit of time but eventually populated the Plugins folder.

1 Like

Thanks guys. This worked for me.