Search code examples
xcodeunit-testinglinkerfbsdk

XCode tests. Clang: error: linker command failed with exit code 1 for FBSDKCoreKit


I added new Tests target to my project, but I have this error even I don't use any FBSDKCoreKit dependencies in the tests. Generally I use CocoaPods, but not for FBSDKCoreKit framework. Tried everything — no results.

ld: framework not found FBSDKCoreKit clang: error: linker command failed with exit code 1 (use -v to see invocation)

Normal Run builds are working perfectly, just tests are not running.

In the test target settings: In the test target settings


Solution

  • My mistake. I just didn't follow all steps from FB doc:

    1. Drag the FBSDKCoreKit.framework, FBSDKLoginKit.framework, and FBSDKShareKit.framework files into the Frameworks group of Xcode's Project Navigator. In the displayed dialog, choose Create groups for any added folders and deselect Copy items into destination group's folder. This references the SDK where you installed it rather than copying the SDK into your app.
    2. Open Xcode's Build Settings tab in your project.
    3. Add ~/Documents/FacebookSDK to the project's Framework Search Paths setting.

    https://developers.facebook.com/docs/ios/getting-started/