Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Include of non-modular header

Hi!

I upgraded to Xcode 6.3 and instantly got hundreds of errors based on the new Swift 1.2 language. Many of these errors had to do with casting (easy fix). But I am getting one that I just cannot figure out.

"Include of non-modular header inside framework module 'FBSDKCoreKit.FBSDKAppLinkResolver'. This happens on the line:

#import <Bolts/BFAppLinkResolving.h>

I have researched online extensively and some fixes, including changing "Allow Non-modular includes in Framework Modules" to YES don't seem to work. Would anyone else have an idea of how to fix it? I'm trying to use the Facebook SDK and I think this is what is causing issues.

Thank you.

Alex Hedley
Alex Hedley
16,381 Points

Are you making a clean build after changing this setting? Did you reload the project or restart Xcode?

Hi Alex - thanks a lot. Yes I cleaned the project and restarted Xcode. Still getting the error. I actually have 4 errors: 1) FacebookSDK/FacebookSDK.h file not found 2) Include of non-modular header inside framework module 'FBSDKCoreKit.FBSDKAppLinkResolver' 3) Could not build module 'FBSDKCoreKit' 4) Failed to import bridging header

I'm stuck. :-(

Alex Hedley
Alex Hedley
16,381 Points

1) If you highlight the FacebookSDK.h what is the path in the File Inspector. Is this File red?

2) You may have fixed with the setting change

3) See https://developers.facebook.com/docs/ios/troubleshooting#xcode_link

4) You may need to check your framework search paths Build Settings > Search Paths) to ../<ProjectFolder>

Thanks! So it looks like the FacebookSDK.h wasn't in my project. That would explain why Xcode is complaining. But it's strange to me because I downloaded the latest version of the SDK and pulled all of the frameworks over into my project, so I would have thought that this would be included. Removing the #import <FacebookSDK/FacebookSDK.h> from the bridging header takes the error count from 4 to 10. So I definitely need it as it has some dependencies. Thanks for the link...i'm going to try that command line code and report back.

thanks again for your help Alex Hedley

Hi Alex Hedley - good news. running that remove script in terminal and adding the SDK back to the project seemed to have worked (i think). Now I'm sorting through several other errors - most of which are of the same kind.

Cannot assign a value of type 'String!' to a value of type 'AnyObject?' Cannot assign a value of type 'PFUser?' to a value of type 'AnyObject?' etc...

I had to change the PFObject! to PFObject? and that messed up everything else

query.getObjectInBackgroundWithId(self.string_objectID) {
                (objects: PFObject?, error: NSError?) -> Void in
                if error != nil {
                    NSLog("%@", error!)
                }
}

The cannot assign...errors are here:

objects["title"] = self.textFieldTitle.text