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 Build a Photo Browser iPhone App Connecting to an API using OAuth Introducing API and OAuth 2.0

Dee Greene
Dee Greene
8,508 Points

"SimpleAuth/SimpleAuth.h" file not found

When I try to import <SimpleAuth/SimpleAuth.h> into THAppDelegate.m in the created Photo Bombers.xcworkspace I get the error "SimpleAuth/SimpleAuth.h" file not found. When I first installed to pod files I got

[!] Pods written in Swift can only be integrated as frameworks; this feature is still in beta. Add use_frameworks! to your Podfile or target to opt into using it. The Swift Pods being used are: Box, ReactiveCocoa, and Result

So I changed my Podfile to:

use_frameworks!

pod 'SimpleAuth/Instagram'

Everything seems to have installed but now I get the above error.

Frank Novello
Frank Novello
19,299 Points

Can anyone please help us....This is very frustrating :/

Frank Novello
Frank Novello
19,299 Points

Would be nice if somebody over at TeamTreeHouse would make a comment on this so we can learn how to implement oAuth

Steven Jemmott
Steven Jemmott
8,109 Points

Go to "Product" and "Clean" the file. Then try to build the project again. My result is 4 errors in the Box.swift file. If I allow the changes Xcode recommends and build again, it leads to even more errors.

7 Answers

Hey guys, I have found a solution after almost losing my entire project update when attempting to add a Parse backend.

UPDATE your Podfile with:

pod 'ReactiveCocoa', '2.4.7'
pod 'SimpleAuth/Instagram', '0.3.6'

This installs ReactiveCocoa's older pod file (pre SWIFT) Dee Greene

Pasan Premaratne - No Problem!

Awesome, thanks Chris!

Raphael Melo
Raphael Melo
6,125 Points

Just got some warnings but it's building! Thanks Chris Hayes !

Dee Greene
Dee Greene
8,508 Points

This builds the project, however when adding the instagram login, I get multiple warnings and 2 errors including

'SimpleAuthProvider.h' file not found
Could not build module 'SimpleAuth'

I can locate 'SimpleAuthProvider.h' in my project however so I am a bit confused. Any help?

Dee Greene
Dee Greene
8,508 Points

Pasan Premaratne any way we can have a video update on how to correctly go about getting everything to run?

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Sorry for the trouble here. And great solution, Chris Hayes! Supporting aging material on a fast-moving platform is definitely a challenge. Dee Greene, Pasan is currently producing new Swift content at an inhuman pace (seriously, I think he may be an Android). I'll ask Gabe Nadel to figure out how best to address this issue until this course is retired and replaced with something else that covers the same topics.

Dee Greene
Dee Greene
8,508 Points

Ben Jakuben no worries. Thanks for the help and keep up the good work Pasan Premaratne

ASHRAF HARIRI
ASHRAF HARIRI
3,943 Points

Hi the following Podfile works fine with me:

pod 'SimpleAuth/Instagram'

xcodeproj '/your project path/Photo Bombers/Photo Bombers.xcodeproj'

link_with 'Photo Bombers','Photo Bombers Dev','Photo Bombers Tests'

use_frameworks!

Then I followed the steps mentioned in the following URL:

http://stackoverflow.com/questions/12002905/ios-build-fails-with-cocoapods-cannot-find-header-files

Frank Novello
Frank Novello
19,299 Points

i get a bunch of errors trying to build

Frank Novello
Frank Novello
19,299 Points

I am having the same issue and i am very frustrated.

Dee Greene
Dee Greene
8,508 Points

yea i have been stuck at this same point in the video until we can get this cleared up

Cotten Blackwell
Cotten Blackwell
10,425 Points

I am having this same issue and stuck also -- I'll contact Support separately from this thread right now...

Steven Jemmott
Steven Jemmott
8,109 Points

I'm also getting stuck with this problem. The podfile is loaded and I have the workspace but the "Box.swift" file is causing errors.

Frank Novello
Frank Novello
19,299 Points

Let us know how that goes. Thanks

Cotten Blackwell
Cotten Blackwell
10,425 Points

FYI only...


Treehouse Support help@teamtreehouse.com 2:40 PM (17 hours ago)

Hi Cotten,

Thanks for letting us now! We'll get this to the teaching team to chime in right away.

Best, Chelsey


On Thu, Oct 1, 2015 at 5:33 PM EDT, Cotten Blackwell cotten.blackwell@gmail.com wrote:

Folks, we've got several people stuck on the same issue, some for up to 10 days, with no help so far:

https://teamtreehouse.com/community/simpleauthsimpleauthh-file-not-found

Please help!

Thanks,

Cotten

ASHRAF HARIRI
ASHRAF HARIRI
3,943 Points

after resolving the Podfile issue, it seems the SimpleAuth file contain a lot of swift errors!!

Steven Jemmott
Steven Jemmott
8,109 Points

How did you go about fixing the errors caused in the swift files? Some of the errors seem to be caused by the new Swift 2 syntax.

Pasan Premaratne
STAFF
Pasan Premaratne
Treehouse Teacher

Hi everyone here!

Tagging everyone so I can figure out what's going on: Dee Greene, Steven Jemmott, Frank Novello, Cotten Blackwell and ASHRAF HARIRI. I think that's everyone.

I don't think I fully understand the issues here so here's a question or two.

  • Are you attempting this project in Swift? Or is your project in Objective-C and you're running into Swift code when you add the pods to your project?
  • If you are attempting the project in Objective-C, do you actually want Swift code? Or is it a lack of choice cuz that's what' the specified pods bring in?
Frank Novello
Frank Novello
19,299 Points

I am one who is using objective-c and it seems the simpleAuth framework is composed of a bunch swift files.

Pasan Premaratne
Pasan Premaratne
Treehouse Teacher

Frank Novello,

Ok I think I've figured out what the problem is (and by figured out I mean in my head, I haven't actually tried building the project) and it's not a simple one.

The SimpleAuth library has it's own set of dependencies one of which is ReactiveCocoa. ReactiveCocoa was recently rewritten completely in Swift so that's the Swift code that's getting added to your project. Unfortunately there are 2 versions of ReactiveCocoa out there, written in Swift 1.2 and Swift 2.0. SimpleAuth is currently automatically pulling the 1.2 version of ReactiveCocoa.

Swift 1.2 can only be run in Xcode 6.1 and not in Xcode 7 (which requires Swift 2).

So if you are using Xcode 7, then you're pulling in the Swift 1.2 version by default and this is causing all the Swift errors.

Also, you have to do some cleanup work to get Swift frameworks to run in a mixed Objective-C/Swift project which includes adding a bridging header and stuff. Does any of this sound remotely familiar to you?

Frank Novello
Frank Novello
19,299 Points

If you could, or somebody else over at treehouse please make an empty single view application(in obj-c). Make the Podfile and try getting the workspace to run. List us the steps you took to get it to run.

Dee Greene
Dee Greene
8,508 Points

I agree with you. That would be nice is tree house could do this. I've been stuck for a few weeks now.

Pasan Premaratne
Pasan Premaratne
Treehouse Teacher

Unfortunately it's not that simple in this case because the library you are pulling in belongs to someone else. You could ask them to restrict the dependencies to use Objective-C only and not Swift (which probably won't happen) or to update it to the latest version of Swift so you can use it with Xcode. Either way that's a decent amount of work they have to do and you can't do anything but ask politely and wait.

If you are ok with using some Swift code you can work with this library but only if you have an Xcode version between 6.1 and 7.0. The version of the Swift code that is imported is incompatible with Xcode 7 and fixing it is not an easy task. There are about 65 fixes I had to make and I wasn't done.

Unfortunately we may have to take this course down because of this but I'll try and investigate solutions

Dee Greene
Dee Greene
8,508 Points

If you have to take the course down would you consider replacing it with a course on creating a layer+parse messaging app? It could build off the Ribbit one. I feel a lot of students would enjoy this.

Pasan Premaratne
Pasan Premaratne
Treehouse Teacher

Dee Greene,

I honestly can't guarantee that. It's not because I don't want to. Parse is awesome and easy to build stuff with, but a Parse course, or any course that uses an external resource runs into the same problem as you are encountering here. Changes to external services are completely outside my control and break entire courses forcing us to retire perfectly good content.

We try to stick to Apple's development stack as much as possible and teach a good general programming foundation so that you have the knowledge to use whatever service you prefer. The Ribbit course is also broken to a certain degree because Parse has changed since and we'll be retiring that soon as well.

For now all I can say is that I'll add it to the list of requests!