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.
Some selected answers I've tried to apply without success:
Apple Mach -O Linker command failed
In Xcode how do I create a new workspace and add 1 project to it so that I can see the project and its files?
Framework not found GoogleToolboxForMac
Adding system header search path to Xcode
https://github.com/firebase/firebase-ios-sdk/issues/258
Apple Mach-O Linker & Ditto Error - Xcode 8
https://github.com/invertase/react-native-firebase/issues/198
https://forum.ionicframework.com/t/ios-xcode-8-apple-mach-o-linker-ld-error-group-in-xcode/89903
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
Related
I am using Xcode 8.2.1, Swift 3, and IOS 10.2 (for iphone simulator). I am trying to follow this tutorial https://www.raywenderlich.com/139322/firebase-tutorial-getting-started-2
I have not gotten to the Firebase stuff. Right now I am just trying to build and compile the starter code (should run fine). When I do this, however, I get the following error:
ld: library not found for -lPods-Grocr
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do I fix this? PS. I have done a pod install successfully.
When I first began working with Firebase I encountered many issues like this and for a while wondered if scrapping the whole Application and restarting was the best option. In the end the fix was simply, getting rid of the modules inside my app and uninstalling the pods then going back through the process of installing them. Sometimes a file will be place in the wrong directory so when the app goes to build it is looking for something that cannot be found and it fails. Good luck let me know if you have any more questions or issues.
I want to add Appsflyer framework in my project. Added by two ways
Downloaded the framework and imported it to project. Added in Linked Frameworks and Libraries. When i Compile it shows the error of "ld: framework not found AppsFlyer. Linker Command failed with exit code -1".
Tried with Cocoa pods. Created podfile and installed Appsflyer framework.
Here also i get the same error."ld: framework not found AppsFlyer. Linker Command failed with exit code -1".
Tried with all options from stackoverflow. By using Header search paths, Library search paths and framework search paths.Enabling Bitcode, Build Active Architecture only etc. Even though i get the same result.
Iam using Xcode 6.3 and tried with xcode 7.3 also.
Suggest me how to resolve the problem? Thanks in advance.
What I have done after 2 days of reading stack overflow:
Keywords to problem: "Apple-Mach-O Linker Error", "libGcmLib.a(GCMRmqManager.o)", sqlite3", "GCMRmq2PersistentStore"
Installed latest pod.
Tested 'Other Linker Flags' -ObJC and empty as well.
Cleaned the project and rebuilt. Deleted project and recreated, no help. Header is in the right path and properly configured.
Manually copied dependencies but it didn't help.
Manually copied new source code from Google's Github as well as their recently updated 'GCM Playground', nothing worked.
Integrated CoreData.framework to no avail.
Tried these solutions:
Apple Mach-O Linker Error when compiling for device,
CocoaPods adds incorrect Other Linker Flags, Google Cloud Messaging Bridging Header import fails, Xcode - symbol(s) not found for architecture x86_64 (iOS Lib), Undefined symbols for architecture arm64, Apple Mach-O-Linker Error CocoaPods, Swift iOS don't recognize GCM library imports?
So I am stuck. How do I solve the problem(s) displayed in the image below: "sqlite3.... ", referenced from: "GCMRmq2PersistentStore in libGcmLib.a(GCMRmqManager.o)?
IMAGE
GCM seems to be using sqlite3 in the library. You should link your app against it to build it. You tried integrating CoreData but it should rather have been sqlite3.
You should also check CocoaPod's generated xcconfig file i.e. Pods/Target Support Files/Pods/Pods.debug.xcconfig file and the OTHER_LDFLAGS option should have -l"sqlite3" in it. That should have linked it for you.
I encountered an issue after setting up a new value for Configuration when building (after reading the following post: Different App Icons for your iOS Beta, Dev, and Release builds). The error message is as follows:
ld: file not found:
/Users/.../Library/Developer/Xcode/DerivedData/SomeAppName-.../Build/Products/Debug-iphoneos/SomeAppName.app/SomeAppName
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
I'm not sure how to fix it, checked and double checked with the article and I did follow everything as explained.
Edit: The error appears to be from the Tests target
Managed to find the answer: https://stackoverflow.com/a/29887473/2124535
I solved it in Xcode 6 very easy like this:
Select your project in the project navigator.
Select the YourProjectTests under targets
Under General tab change the Host Application from the drop down
Build and run.
This problem happened to me because I renamed my project and the tests could't find it anymore. - Yowza7
Removing the Tests target did not help for me.
I posted a solution that did work here: Created new XCode Configuration and Scheme - linker is suddenly failing
It basically involves telling Xcode to look for the libraries created using the Release configuration.
I'm getting the following error after upgrading Xcode to 4.6 and building my Kobold2D project:
ld: file not found: /Users/Jon/Library/Developer/Xcode/DerivedData/Kobold2D-
awxpgwvfoipnxpdyaptbdirnnfwq/Build/Intermediates/ArchiveIntermediates/Kodable-
iOS/BuildProductsPath/Release-iphoneos/libkobold2d-ios.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It happens only when building the IPA with product>archive. I can run directly on the device no problem. This leads me to believe its a distribution permissions setting.
I've done some research on the error here, and also reviewed similar questions on SO. I have an idea of what the problem is, but none of the solutions seem to fix the issue.
This only just happened with Xcode 4.6. I've been able to build IPAs before no problem, and even have the app in the App Store, so I don't know what changed to cause this.
I figured this out today, so I will answer it for anyone else that might have this problem.
Somehow the libkobold2d-ios.a file (along with a few others) were removed from the "link binary with libraries" section of build phases. I definitely didn't do that manually, so I don't know why they were missing, but when I added them back it worked.
A quick note - They will still show up as red, because they have to be built at compile time.