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
Related
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.
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.
Trying to insert Google Ads/Firebase into a test app. Suspect I've almost got this working but. Using the Google notes from https://firebase.google.com/docs/admob/ios/quick-start
When I compile I receive "Linker code failed with exit code 1":
ld: warning: directory not found for option '-L/Users/edward/Library/Developer/Xcode/DerivedData/TotalConversion-gtwxqoywudjqpodqkpfpwcnovyuz/Build/Products/Debug-iphoneos/GoogleToolboxForMac'
ld: library not found for -lGoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have created the Podfile as instructed with:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ’7.0’
target 'TotalConversion' do
pod 'Firebase/Core'
pod 'Firebase/AdMob'
end
and then run a pod update. I don't see a .xcworkspace file referred to in the docs. Does the iOS, '7.0' line above need to be altered?
I presume that using pods GoogleAds is instead of the standard framework (Build Phases/Link Binary) approach.
If there is a linker error, this might be few things. First, check if you haven't open .xcodeproj instead of .xcworkspace by mistake. If not, the solution might be simple project cleaning by pressing cmd+shift+k. At last, check if those libraries are linked with project and are having status required in your target's general/build phases (Pods_YourProjectName.framework).
In Podfile you can actually comment out lines with source and platform by placing # in front of them. Go to terminal, cd to your project directory and try pod install once again, maybe that will do the job.
Sorry for not placing this in comments but my reputation doesn't allow me doing it.
The {projectName}.xcworkspace folder should be in the same folder as the .xcodeproj that you have open. Close Xcode {projectName}.xcodeproj instance and open {projectName}.xcworkspace using the Finder, command line, or Xcode open.
I have a pretty classical error during my project building:
ld: library not found for -lAppLovinSdk
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Originally I got the library from Cocoapods pod, but then I started having a lot of errors and decided to remove the pod from the Podfile and executed pod update
My Podfile looks like this:
I've tried to clean project, reinstall the Podfile, deleting Pods folder and Podfile.lock file, "Build Active Architecture Only" is set to "No", but I still have the error. I assume I still have some references to libraries from the deleted Pod. What is the way to get rid of them?
UPDATE: Here is a full error message:
Ok, so I figured out the problem:
I had to go to Target -> Build Settings -> Linking -> Other Linking Flags and there I had to remove all deleted libraries references, manually. And then it worked!
Xcode version: 7.0.1.
OS-X: Version 10.11 Release.
Project details: Built for iOS 7 or above, CocoaPods: AWSCore (Problematic one, other Pods build fine), other developers are on Xcode 7.0.1 as well but not on El Capitan.
When I try to build, I get "linker command failed with exit code 1 (use -v to see invocation)", along with a few warnings linked to the error.
Warning 1: "ld: warning: directory not found for option '-L/Users/sonny/{PROJECT_NAME}/build/Debug-iphoneos'"
Warning 2: "ld: warning: directory not found for option '-F/Users/sonny/{PROJECT_NAME}/Pods/HockeySDK/Vendor'"
Warning 3: "ld: library not found for -lAWSCore"
Solutions
I've tried: I've tried a complete pod remove master repo, pod setup, pod install. I've tried verifying that the architecture settings are the same for build on both my project target and pods target. I've tried deleting entries on Testing->Debug && Release in Build Settings along with putting $(inherited) in all the linker files and framework search entries.
Other issues that might be related: In the Project Navigator, all of my Frameworks Podfiles are red, indicating an incorrect folder reference. But wouldn't pod install correct this? I simply can't find the pods.a files anywhere in my project folder but I do not know if this is what's causing the build to fail.
Project builds for all other developers but not me or my supervisor. I'm on El Capitan but he isn't.
Solved:
This was my solution and keep in mind, the solution for everyone will be different -
In {Project Name} target, under your specific "General" if you scroll down you'll have a list of Frameworks. You want to delete ALL the Pod listings there "libPods-this or that.a". Those frameworks have been linked in a bash script and in other places during a Pod install, but Pod install didn't delete them from the project build listing.
Once you remove all those, it should build.