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
chriscameron
15,397 PointsIncorporate Photo Bomber App into Self-Destructing App
Howdy, I've been working through a project of my own where I want the functionality of both of the above mentioned apps. Unfortunately I keep getting the error of: Undefined symbols for architecture i386: "FBTokenInformationExpirationDateKey", referenced from: -[PFFacebookTokenCachingStrategy cacheTokenInformation:] in Parse(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy expirationDate] in Parse(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setExpirationDate:] in Parse(PFFacebookTokenCachingStrategy.o) "_FBTokenInformationTokenKey", referenced from: -[PFFacebookTokenCachingStrategy accessToken] in Parse(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setAccessToken:] in Parse(PFFacebookTokenCachingStrategy.o) "_FBTokenInformationUserFBIDKey", referenced from: -[PFFacebookTokenCachingStrategy facebookId] in Parse(PFFacebookTokenCachingStrategy.o) -[PFFacebookTokenCachingStrategy setFacebookId:] in Parse(PFFacebookTokenCachingStrategy.o) "_OBJC_CLASS$FBAppCall", referenced from: objc-class-ref in Parse(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS$FBRequest", referenced from: objc-class-ref in Parse(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS$FBSession", referenced from: objc-class-ref in Parse(PFFacebookAuthenticationProvider.o) "_OBJC_CLASS$FBSessionTokenCachingStrategy", referenced from: _OBJC_CLASS$PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o) "_OBJC_CLASS$SLComposeViewController", referenced from: objc-class-ref in Parse(PF_Twitter.o) "_OBJC_CLASS$SLRequest", referenced from: objc-class-ref in Parse(PF_Twitter.o) "_OBJC_METACLASS$FBSessionTokenCachingStrategy", referenced from: _OBJC_METACLASS$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o) "_SLServiceTypeTwitter", referenced from: -[PF_Twitter getAccessTokenForReverseAuthAsync:localTwitterAccount:] in Parse(PF_Twitter.o) -[PF_Twitter getLocalTwitterAccountAsync] in Parse(PF_Twitter.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've tried to find this without any luck. I'm not trying to use the Parse framework to join or sign in to Facebook / Twitter.
Any help would be fantastic guys!
10 Answers
chriscameron
15,397 PointsOk guys. Firstly I'd like to say thank you so much, you are both Gems. I have no idea why I didn't type the two together in Google but alas I have found it.
And incase someone else gets caught on this.
In your Podfile enter: pod 'Facebook-iOS-SDK' https://parse.com/questions/cocoapods-incompatibility
On a side note, the file seems to throw back 8 issues, but they seem to be non issues. Especially since I'm not actually using Facebook.
John Coffin
10,359 PointsAwesome!
John Coffin
10,359 PointsI've never seen this specifict problem (much less solved it), but I have dealt with similar problems many, many, many times. I'll do my best to try and help. I apologize in advance for the bullets, but if I don't do this, I'll write a book.
So, in no specific order ...
undefined symbols for architecture is something that is caused when you (or the underlying library) is calling a function that exists but for which you do not have the implementation in the form of a shared library. In this case, it would be a missing JAR file.
Make sure that you have imported the JAR file properly.
Make sure that you have the right version.
If it isn't "the obvious", the most useful thing that you could do is to narrow this down to a single line of code. Depending on how much "Parse" code you have, you could comment it out and start adding in line by line (or use the Newtonianesque method by commenting out half the code that uses parse and looking to see if the problem disappeared). If you do not have the project on GIT (or other source control), it might be a good time.NOTE: Based on your forum message, I understand that you have already tried to do this and have been unable to; I am including this step for completeness (i.e. someone else might have a similar problem and find this in a web search, in which case, this line might help them).
The call stack suggests that the function in question is of the form "Parse()" so it shouldn't be hard to find (the constructor, perhaps).
If you can find the line, then check how you are calling it. It may be one of the parameters that you are setting.
Maybe not in your code but in something that you are including (which requires some other dependancy).
What is the last step that you took before you saw this problem? Does undoing it make the problem go away.
I see the words "for architecture i386" and cringe just a little bit. In my case, I have a 64-bit operating system, and I am endlessly running into problems and after a long, hard slog find out that I installed conflicting versions of JAVA using 32-bit and 64-bit installers. A quick look at "installed software" will tell you if this is true; determining if this is a problem or a requirement to keep all of your software running ...
Have you contacted Parse (or checked the support groups)? If not (and none of these steps help), then you should. It may be a problem in their software, and their may be a known solution.
I hope that this helps.
John Coffin
10,359 PointsSummary: If you imported Parse properly and you cannot narrow it down to a line of you code, then one of the other 3rd party imports may be expecting Parse in particular location or a specific version of it and the error occurs because it cannot find it.
John Coffin
10,359 PointsJust out of curiosity, for which OS are you compiling, and which IDE and language? The "i386" leads me to believe that this is a 32-bit Windows application, and because Treehouse doesn't teach using any MS products, I am assuming that you're using a Java IDE (i.e. Eclipse).
Patrick Cooney
12,216 PointsThese projects are for iOS. So it's objective-C code.
Patrick Cooney
12,216 PointsI'm guessing your frameworks didn't get loaded properly. How did you combine projects? Did you just copy one project into the other?
chriscameron
15,397 PointsHowdy guys, sorry it's been a busy day. So, John, it is in objective-C for iOS. I have gone away with what you said earlier and tried to find something on Parse. And I thought I had however, unless I am implementing their instructions wrong, it doesn't work.
Patrick, I have built both apps individually following along with the tutorials. Then I have actually gone back and followed each again, this time round adding extra snippets for what I need the app to do. (Adding a collection view to storyboard at the end of the Self-Destructing App, in order to begin the Photo Bomber functions, and it is here, after adding the CocoaPod (as described in the Cocoa Pod workshop), that the App fails.
Thanks guys.
John Coffin
10,359 PointsWhat he said.
If this doesn't work out, I found an explanation at Parse.com which may apply:
"I'm using RestKit which, according to their install guides, require to use the -ObjC and -all_load linker library flags.
Apparently doing so when using Parse will attempt to load all dependencies required by parse, including the Facebook SDK."
I found this link from another user with the same problem.
Hope it helps. I unfortunately have no way to verify or test.
John Coffin
10,359 PointsIt appears we cross posted.
Patrick Cooney
12,216 PointsTo build on what John is saying, when an application is being built in a compiled language you have the notion of a compiler, a linker and a loader. You can look these up to see what each does. Your error message relates to the linker which finds all the files to provide to the compiler to build the executable. So, if you are having a linker error, it's probably because there is an issue locating the files. Try removing the libraries and frameworks and re-importing them.
John Coffin
10,359 PointsWell said! It is very important to understand the problem before lumbering off and searching for solutions. For some reason I tend to forget that.
chriscameron
15,397 PointsHa. Yeah. That's the exact answers I have since tried with no luck unfortunately.
John Coffin
10,359 PointsUgh.
Well, I noticed another post at Stack Overflow which seemed plausible, but at this point I am just guessing. I wish I had more iOS experience so that I could give you an informed answer, but I think that the concept -- a dependency is missing -- is correct and that it is not your code. Maybe one of the gurus can shed some light so that we're not looking for a needle in a haystack. Gurus?
John Coffin
10,359 PointsCross-posted again. Check Patrick's last comment. This seems the right way to go.
chriscameron
15,397 PointsOk guys. I'm kind of hoping one of you have played more with CocoaPod than I have. Erm.. How would I find the pod library /path/to/ ? ? ?
Just to let you know I have tried all of your suggestions, just so you know I am listening hehe.
John Coffin
10,359 PointsJohn Coffin
10,359 PointsI would be great if you could switch this from "General Discussion" to "iOS." Not only would it be easier for people to find it, but it would also allow us to up vote the solution that you found.