Search code examples
iosxcodeios8xcode6ios-app-extension

Adding Today Extension Fails To Compile


I recently set out to build an iOS 8.0 Today Extension into an existing project but I'm having trouble getting started. Before adding the today extension I was able to open my project in Xcode 6 and run without any issues.

However, after I add the extension the compiler gives me the following error:

fatal error: 'Mantle.h' file not found Command /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

More details:

  • Using Xcode 6 beta 3
  • Using CocoaPods (Mantle.h is from a pod)
  • Added today extension but I don't create scheme for it. I previously tried creating a scheme but that doesn't work either.
  • I've been trying to run using previous app target. I've also tried using the extension target but that fails to build with the same error.

Compile Error

I created a new project to see if I had the same issue but I'm not able to reproduce it. What does adding the extension change in my project that might be causing this? Note, this is an error in my existing files, not a new file I created for the extension. I have done nothing but add the extension to my project.


Solution

  • The problem was that the .pch file was referencing files the extension didn't have access to. Creating a new .pch file fixed it.