Xcode - clang failed with exit code 1. Plugin cause?

I'm getting an odd error in Xcode when I try to Archive my app.

I'm using Ionic and the Ionic CLI tools. The app has been built for Android and is in beta on the Google Play store.

In Xcode I get this error:

clang: error: no such file or directory: '/Users/SubjectiveEffect/myApp/platforms/ios/CardsApp/Plugins/de.appplant.cordova.plugin.email-composer/APPEmailComposer.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

So it looks like there is some error with the de.appplant email plugin. The email plugin works in Android but it doesn't work in Ionic View on iOS. I wasn't sure if this was that the plugin isn't Ionic View compatible or not.

Anyone have any ideas?

Upate:

I uninstalled this plugin and I now get the same error, but from a different plugin!

clang: error: no such file or directory: '/Users/SubjectiveEffect/myApp/platforms/ios/CardsApp/Plugins/com.danielcwilson.plugins.googleanalytics/UniversalAnalyticsPlugin.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

So I'm pretty sure this is a plugin problem.

Anyone have any idea why or how I can fix it? I'm installing from the command line on a Mac with the standard cordova commands as seen on ngCordova.

edit: To be clear - those folders do not, indeed, exist. The plugins work fine in Android though...

Your error is quite strange, probably something happened to the structure folders.. I would try doing something like this:

Before doing this test make a backup copy of platforms/ios.

cd my-folder-app/
ionic platform remove ios
ionic platform add ios

Now should need to copy from backup and paste for example the icons, splash screens to the fresh platforms/ios folder and re-apply some eventual changes that you did.

ionic build ios

And then open xcode:

  • Run the app on emulator or device to test if works
  • Disconnect the device
  • Select the schema and iOS Device

enter image description here

If you need configure the schema, first you need to edit it:

enter image description here

Select Archive from the left panel, and from the right there is Build Configuration: select Release if you want publish the app or Debug if you want install the app on a test device. And click Close.

  • From the top menu: Product > Archive

Good luck!

UPDATE:

To be sure that your errors not depends to the ionic project make this test please:

cd projects-folder/
ionic start myTestApp tabs
cd myTestApp/
ionic platform add ios
ionic build ios

And now follow the same steps on xcode to archive the app.

I never really found out what was happening.

What I did was remove the iOS platform and re-add it. This just created more errors although for some reason the correct folders were there. I also then found my Android build wouldn't work.

I removed everything and re-added it all, updating Ionic too.

Then XCode would open but freeze. Hard freeze. The only way to quit it was to force close the Mac. I even uninstalled XCode and re-installed it. Same thing.

Finally I used the command line to erase all presets in XCode so it would open fresh without any projects loaded. Now it works, and the Android version seems to be working too.

I've no idea where the error started and so I can't rightly tag anyone as correct as that would be misleading. The solution: cleans and burn, start again. :)