Why it shows "ld: framework not found Bolts" - ios

After I install facebook sdk, when I build my project, it shows:
ld: warning: directory not found for option '-F/Users/liyuanliu/Library/Developer/Xcode/DerivedData/c5-dsovqtraubbdgxbqrmiexjmlysxq/Build/Products/Debug-iphonesimulator/Bolts'
ld: warning: directory not found for option '-F/Users/liyuanliu/Library/Developer/Xcode/DerivedData/c5-dsovqtraubbdgxbqrmiexjmlysxq/Build/Products/Debug-iphonesimulator/FBSDKCoreKit'
ld: warning: directory not found for option '-F/Users/liyuanliu/Library/Developer/Xcode/DerivedData/c5-dsovqtraubbdgxbqrmiexjmlysxq/Build/Products/Debug-iphonesimulator/FBSDKLoginKit'
ld: warning: directory not found for option '-F/Users/liyuanliu/Library/Developer/Xcode/DerivedData/c5-dsovqtraubbdgxbqrmiexjmlysxq/Build/Products/Debug-iphonesimulator/FBSDKShareKit'
ld: framework not found Bolts
clang: error: linker command failed with exit code 1 (use -v to see invocation)
But when I install facebook and bolts, it shows I install them successfully:
pod install
Analyzing dependencies
Downloading dependencies
Using Bolts (1.8.4)
Using FBSDKCoreKit (4.14.0)
Using FBSDKLoginKit (4.14.0)
Using FBSDKShareKit (4.14.0)
Using Firebase (3.4.0)
Using FirebaseAnalytics (3.3.0)
Using FirebaseAppIndexing (1.0.4)
Using FirebaseAuth (3.0.4)
Below is my build phases image :
And below cannot find bolts framework image
I cannot find the FBXXXX.framework
After I add frameworks, it still exits:

I solved the problem by deleting the ~/Library/Developer/Xcode/DerivedData/xxxx while xcode was closed and then reopened xcode and did a clean + build. All was fixed up when xcode rebuilt the derived data for the project.

Please try below steps
From Podfile directory run below commands in terminal
pod deintegrate
pod install
Clean Derived Data folder from Xcode
Perform fresh clean build

Go to Project->TARGETS-Build Phases->Link Binary With Libraries Attach your Bolts library here.
Now click on + button ->
Now Click on Add Other.. Button->Find the FBSDK framework on your computer & attach it. Compile & run your application .

Finally, I found a solution to solve this problem. In project->targets->build settings->framework search path, there are many paths already existed. I download 4 frameworks(bolts.framework and 3 other FBXXXX.framework) and copy all of them inside one of these existing paths.

The problem is that the suggestion at https://developers.facebook.com/docs/ios/getting-started of not Deselect Copy items into destination group's folder. is not appropriate on Xcode 8.0, the most popular atm. Dragging the frameworks would move them to the new Frameworks folder.
So follow the tutorial but keep the tick on Copy items into destination group's folder

Finally got solution for them if they are using pod
pod 'FBSDKLoginKit', '4.43.0'
pod 'FBSDKCoreKit', '4.43.0'

Answer on the behalf of the author of the post:
Finally, I found a solution to solve this problem. In project->targets->build settings->framework search path, there are many paths that already existed. I download 4 frameworks (bolts.framework and 3 other FBXXXX.framework) and copy all of them inside one of these existing paths.

Related

Unable to build Project after pod init in an old xcode project

I am trying to init pod in an old code base. Whatever I do, I am not able to run my project after git init. There is always build error. I am getting following error,
ld: warning: directory not found for option
'-F/Users/usr/Library/Developer/Xcode/DerivedData/MyApp-some_code/Build/Products/Debug-iphonesimulator/FBSDKCoreKit'
ld: warning: directory not found for option
'-F/Users/usr/Library/Developer/Xcode/DerivedData/MyApp-some_code/Build/Products/Debug-iphonesimulator/FBSDKShareKit'
ld: warning: directory not found for option
'-F/Users/usr/Library/Developer/Xcode/DerivedData/MyApp-some_code/Build/Products/Debug-iphonesimulator/FacebookCore'
ld: warning: directory not found for option
'-F/Users/usr/Library/Developer/Xcode/DerivedData/MyApp-some_code/Build/Products/Debug-iphonesimulator/FacebookShare'
ld: framework not found FBSDKCoreKit
Even if my dependency pod file is empty then I get
pods framework not found.
My Framework Search Paths is set to to $(inherited), which is build/Debug-iphoneos/FBSDKCoreKit.. I have also tried to set this path to pods folder under project. But nothings works. Even I have same issue with another project also.
Xcode version : 12.3
Code base is in Objective C.
I have experienced a similar problem before in the past, using FacebookSDK frameworks.
Of course, if you were using Swift, you could easily import it with Swift Package Manager.
Try to perform the following steps
1. Edit your podfile
Making explicit reference to the version and project name
pod 'FBSDKCoreKit', ‘version’ :project_name => ‘myapp’
2. Delete build data
MyApp-some_code being the appropriate folder name for your app
~/Library/Developer/Xcode/DerivedData/MyApp-some_code
3. Reinstall your pods
The command that you have probably tried a couple of times already
pod deintegrate
pod install
4. Manually add FBSDKCoreKit in Link Binary with Libraries
Navigate to Project->Targets->Build Phases->Link Binary With Libraries
From there click on the plus button and manually add the FBSDKCoreKit framework
5. Deselect copy items to destination's group folder
As per Facebook official documentation, available here.
Check out the point number 3, in particular.

Using the Facebook iOS SDK in a CI build - Framework not found

My React Native app makes use of the react-native-fbsdk package, and I am trying to make the iOS build work on a CI server (Azure DevOps). The main problem is that the Facebook SDK is expected to be installed in ~/Documents/FacebookSDK, which doesn't work on a CI build server.
I've hit quite a few issues. The error I am getting at the moment is:
▸ Linking TzoApp
⚠️ ld: directory not found for option '-L/Users/vsts/Library/Developer/Xcode/DerivedData/TzoApp-bghowrtdysrbywbsslmkxejgzgoc/Build/Products/Release-iphoneos/React'
⚠️ ld: directory not found for option '-F/Users/vsts/agent/2.149.2/work/1/s/tzoapp-mobile/ios/Pods/FirebaseCore/Frameworks'
⚠️ ld: directory not found for option '-F/Users/vsts/agent/2.149.2/work/1/s/tzoapp-mobile/ios/Pods/FirebaseMessaging/Frameworks'
⚠️ ld: directory not found for option '-F/Users/vsts/Documents/FacebookSDK'
❌ ld: framework not found FBSDKCoreKit
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am installing the Facebook SDK via Cocoapods, and have the following in my podfile:
pod 'FBSDKCoreKit', '~> 4.40.0'
pod 'FBSDKLoginKit', '~> 4.40.0'
pod 'FBSDKShareKit', '~> 4.40.0'
My Framework Search Paths are as follow:
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_ROOT}/FirebaseAnalytics/Frameworks\"",
"\"${PODS_ROOT}/FirebaseCore/Frameworks\"",
"\"${PODS_ROOT}/FirebaseInstanceID/Frameworks\"",
"\"${PODS_ROOT}/FirebaseMessaging/Frameworks\"",
"\"$(HOME)/Documents/FacebookSDK\"",
);
and my Header Search Paths are:
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-firebase/ios/RNFirebase/**",
"$(SRCROOT)/../node_modules/react-native-fbsdk/ios/RCTFBSDK/**",
"$(SRCROOT)/Pods/Headers/**",
"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK",
"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK/FacebookSDK",
"${PODS_ROOT}/Headers/Public/FBSDKCoreKit",
"${PODS_ROOT}/Headers/Public/FBSDKCoreKit/FBSDKCoreKit",
);
Can someone help getting the build to work?
Not sure if this is would help, But at least let's try. Look try to copy each of the Framework files from Facebook SDK (FBSDKCoreKit, FBSDKLoginKit, FBSDKShareKit) folder into RCTFBSDK framework folder in the Xcode libraries section like the picture below
Note: Don't forget to check (copy files if needed) when you drop your files inside the framework folder.
Also, clean your project and re-run it again.
Hopefully this will resolve your issue.
I have always found Cocoapods a bit hit and miss. If you read the Cocoapods documentation they recommend not including your Pods directory in your .gitignore. We currently include our Pods in source control. This is partly because some are hosted internally on an internal network not accessible to Azure DevOps. It also has the benefit of developers being able to clone and build straight away.

Linker error after integrating firebase database

After integrate the firebase database, I'm getting linker error:
Undefined symbols for architecture x86_64:
"___cxa_pure_virtual", referenced from:
vtable for leveldb::Iterator in FirebaseDatabase(iterator.o)
It seems like you should link you target against libc++.dylib library (Your app target -> Build Phases -> Link Binary With Libraries).
Also you should add -ObjC flag as stated here: https://firebase.google.com/docs/ios/setup
After integrating firebase pods u have to open .workspace file instead of .xproject file and after opening the file goto build setting -> framework search path then add $inherited into it . Then clean your build and run , hope it works fine..
If possible try installing FirebaseDatabase via cocoapods.
Cocoapods are quick to integrate and highly recommendable while integrating multiple different SDKs.
You can find steps on
https://firebase.google.com/docs/ios/setup.
what you provide info its not sufficient to helps you.
if u r copy the firebase files manually just don't use that process , its not recommended.
use cocoapods for integrating the Firebase its easy: https://firebase.google.com/docs/ios/setup.
for how to install cocoa pods check these steps:
1.First open your terminal
2.Then update your gem file with command
sudo gem install cocoapods
3.Then give your project path
cd /your project path
4.Touch the Podifle
touch podfile
5.Open your podfile
open -e podfile
6.It will open a podfile like a text edit.then set your target .For example if you want to set up Google maps then your podfile should be like
use_frameworks!
target 'yourProjectName' do
pod 'Firebase'
end
7.Then install the pod
pod install
or simply follow the link
https://cocoapods.org/?q=firebase

Xcode error: library not found for -lGoogleToolboxForMac

I am trying to install admobs in my iPhone App (written in objective-c). I have implemented this many times using swift projects, but currently I keep getting the following build error:
ld: warning: directory not found for option '-L/Users/charlieseligman/Library/Developer/Xcode/DerivedData/ThamesClippers-csissodainpbbjenykdyxuutzxtg/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'
ld: warning: directory not found for option '-L/Users/charlieseligman/Documents/GIT/iOS.ThamesClippers/build/Debug-iphoneos/GoogleToolboxForMac'
ld: library not found for -lGoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am definitely opening the .xcworkspace file (and not the .xcodeproj file).
I have also tried deleting 'DerivedData' folder contents & 'Cleaning' the project and doing a 'Clean Build Folder'. None has resolved the issue.
My podfile only includes the following pods:
# Pods for ThamesClippers
pod 'Google/Analytics'
pod 'Firebase/Core'
pod 'Firebase/AdMob'
# Trying to fix GoogleToolboxForMac missing error
pod 'Firebase/Messaging'
pod 'GoogleToolboxForMac/Logger'
pod 'GoogleToolboxForMac', '~> 2.1'
I have tried adding the bottom 3 one-by-one but kept getting the same build error.
Can anyone help? At a complete loss on this one. Seen these two questions but their accepted solutions have not resolved this issue:
Framework not found GoogleToolboxForMac
ld: library not found for -lGoogleToolboxForMac
Finally worked out a fix:
Xcode > Product > Scheme > Manage Schemes
Select to 'Show' the scheme that was failing (GoogleToolboxForMac)
Select this scheme in the dropdown, just to the right of the 'Stop' button
Build this scheme
Then select the original scheme (in the dropdown mentioned in step 3) and rebuild
All built correctly.
So it looked like I had to build the separate scheme manually.
Note: To build these automatically, use Product > Scheme > 'Edit Scheme' > Build > And make sure all targets are added with your project target at the bottom.
I got this error in Xcode 10 when building to the Simulator. This is because I deleted the Debug base configuration in the xcodeproj when attempting to resolve the Cocoapods warning:
"CocoaPods did not set the base configuration of your project because your project already has a custom config set."
I resolved the issue by:
Adding the Debug base configuration
Setting the Debug configuration value to None
Running pod install
This is how the base configuration should look like after step 3:
]1

Xcode cannot find Bolts framework even there is

I reopened a xCode project after 1 month.
I tried to compile, but I run into this error:
"linker command failed with exit code 1 (use -v to see invocation)"
Please, see the image below:
It seems that Xcode is not able to find Bolts Framework even if it is inside the project directory. I tried to delete and re-add it but it didn't work. I checked also the Framework search path but it is correct.
Any suggestion?
Thanks in advance
If you already have -ObjC linked, verify if Bolts is included in your Link Binary with Libraries section of the Build Phases. If it is, try to remove the frameworks from the project and re-adding them, download the frameworks again, but without copying it to your project folder.
If it still doesn't work, try using CocoaPods in your project and add this to your Podfile:
pod 'Bolts'

Resources