Adding Facebook SDK to a project without CocoaPods in Xcode 10 - xcode

I'm not able to build my app with the Facebook SDK in iOS 10. I've included both the "Bolts.framework" and "FBSDKCoreKit.framework" frameworks to my projects. I've also added my Facebook SDK folder to the "Framework Search Paths" in "Build Settings". This is the folder that contains these frameworks.
I'm getting this error and I'm not sure how to resolve it. My project compiled fine in Xcode 9 but won't compile in Xcode 10. Is there another step I'm missing in Xcode 10?
'FBSDKCoreKit/FBSDKCoreKit.h' file not found
UPDATE: Xcode seems to not be able to find the frameworks. This is the error I'm getting. I dragged the frameworks into Xcode from that folder. If I right-click on the framework and click "Show in Finder" it goes right to the frameworks so I don't understand my Xcode can't locate them.
ld: warning: directory not found for option '-F~/MY_FOLDER/FacebookSDK'
ld: framework not found FBSDKCoreKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)
UPDATE 2: Even if I remove that folder from my build options Xcode still complains it can't find the frameworks. I have to completely delete them from my project in order to build successfully.

Related

AFNetworking - ld: library not found for -lAFNetworking

I have an Xcode project with Cocoa Pods installed which I added a tvOS single view app target. I shared with the tvOS target all the pod installed. When I build and run my iOS target everything is ok, but when I run the tvOS target I get this error
"ld: library not found for -lAFNetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)"
So after searching on the web I found a solution to this error. If I go to the Build Settings for the tvOS target and under Valid Architectures I remove arm64 and type armv7 the error disappears but then when i run the project i get this: the file couldn't be opened because you don’t have permission to view it.
First, you must sure you're opening the .xcworkspace file, not the .xcodeproj file.
Then, open your project folder and run command pod install and reopen .xcworkspace file it will fix your issue.

xcode librarby not found for -IRCTNetwork

I have react native project that I'm trying to run with xcode.
when i run it shows me the error
ld: library not found for -lRCTNetwork
clang: error: linker command failed with exit code 1 (use -v to see invocation)
actually, i don't know what is -RCTNetwork,
it's not any plugin I installed.
This error occurs because you haven't added or linked the network library to your Build Phases in Xcode.
Drag the file, RCTNetwork.xcodeproj from node_modules/react-native/Libraries/Network/
to the libraries file in Xcode.
Then click on Build Phases on the top right-hand corner in Xcode.
Click the drop down of Link Binary With Libraries, then the + sign to add the libRCTNetwork.a
Run the build and restart your emulator or device.

XCode 8 - Build works but archive fails - React Native

I have an haunting issue. I am trying to build an React Native app in Xcode 8. Build/Run in Simulator works fine but as soon I start to archive I am getting the following error:
Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
That's the only error and it's after all steps have been completed with no further explanation.
Now I installed Fastlane and found out that it fails because of duplicate symbols. Removing the duplicates from "Linked Frameworks and Libraries" solves the issue and allows me to archive the app.
However now I can't build anymore for the simulator because of missing symbols.
I been looking into this for 2 days now and I can't find a solution.
Anyone has an idea why this is happening and how to solve it?
I found the solution for it!
Based on this thread https://github.com/facebook/react-native/issues/12814 if you use Pods, it also includes the base react project which will end up causing the duplicate references.
In order to fix this issue, the react reference need to be removed:
Open your [yourproject].xcworkspace
Select your Pods project
In TARGETS delete React. (clicking on the minus button - below of the targets list.)
Clean (Product > Clean) & archive/build/whatever.
Kudos to andfk for this solution!

Cordova + Xcode8 = Linker command failed with exit code 1

Everything was working fine until I updated the iPad and now I can't build/install my app any more. I get the error message:
ld : framework not found Pods_myproject
clang: error: linker command failed with exist code 1
I tried to add/remove ios platform, clean ios both in cordova and xcode, remove pods folder and files, did a pod deintegrate, redid pod init and pod install, quit xcode, nothing works.
Check your Xcode project, you probably link to "Pods_myproject" somewhere.
Open Xcode
Click on your project
See the 'General' tab.
Remove Pods_myproject from Linked Frameworks and Libraries and Embedded Binaries
If still not resolved, search for Pods_myproject on the top right.

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:
My mistake. I just didn't follow all steps from FB doc:
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.
Open Xcode's Build Settings tab in your project.
Add ~/Documents/FacebookSDK to the project's Framework Search Paths setting.
https://developers.facebook.com/docs/ios/getting-started/

Resources