0

I'm trying to import Firebase into my iOS app. I followed this tutorial for doing this manually with Objective-C (as opposed to using CocoaPods).

http://www.mokacoding.com/blog/setting-up-firebase-without-cocoapods/

When I try to build my project, I get the following errors:

"Apple Mach-O Linker Error"
"Linker command failed with exit code 1 (use -v to see invocation)"

I'm familiar with the Linux CLI (less so with Macs), but I don't understand how to apply the -v flag to XCode's build process to get more info.

I've been Googling this for the last 3 hours, but every answer I find seems to be directed at users who weren't using an XCode workspace with CocoaPods.

I don't have CocoaPods installed, so I don't think this is my issue. Despite that I have converted my project and properly imported it into an XCode workspace, this still didn't solve my problem.

My app is a Swift project, and I have imported the modulemap, firebase.h, and googleServices.plist files.

I've also made my Header and Library search paths recursive for the entire project folder in an attempt to fix this.

Here's my project navigation. Although at this point I suspect it's some kind of build setting that isn't correct.

enter image description here

Some selected answers I've tried to apply without success:

Grant Miller
  • 27,532
  • 16
  • 147
  • 165
  • You should be able to see more info about the failure in the Xcode build log - https://stackoverflow.com/questions/19014359/how-do-i-view-the-full-build-log-on-xcode5. Perhaps missing -ObjC in OTHER_LDFLAGS? – Paul Beusterien Jun 19 '18 at 22:25
  • I have -ObjC in OTHER_LDFLAGS – Chris Gray Jun 19 '18 at 22:54

1 Answers1

0

Upgrading to xcode 9.2 fixes this. It appears to be an issue with earlier versions not properly handling linking.

Which is misleading b/c the firebase documentation indicates it's compatible with xcode 8. But I think that's assuming you use cocoapods. If you don't, and instead try to link the obj-c frameworks you need xcode 9+

Once I knew how to examine the more verbose linking error, googling for x86_64 led me to some helpful answers.

This and other answers helped me investigate upgrading.

ld: framework not found Stripe for architecture x86_64