I updated pods for SalesforceSDKCore 4.3.1 and SalesforceRESTApi 4.3.1. When I did pod install it in turn installed cocoaLumberjack library which is a dependent library I suppose. After successful install of Pods, I couldn't build successfully, as I am getting this error -
ld: library not found for -lCocoaLumberjack
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I deleted my Library search paths, added/deleted inerited in Other linker Flags, nothing seem to work. These are my search path and other linker flag settings.
My Pod file -
# platform :ios, '8.0'
target 'Custom' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for Custom
source 'https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
pod 'SalesforceSDKCore'
pod 'XMLDictionary', '~> 1.4'
pod 'SalesforceNetwork'
pod 'SmartStore'
pod 'SmartSync'
end
I had the same problem. I tried many solutions, some of them are:
File/Workspace Settings/Derived Data Arrow -> Delete DerivedData folder, empty trash
Terminal -> pod deintegrate , pod install
If you renamed your target's name, then:
Target/Build Settings/Test Host :: $(BUILT_PRODUCTS_DIR)/TargetName.app/TargetName
I really hate this linker command failed problem. I get it all the time and every time I need to follow another solution to solve this. I must have given over 30 hours of my life to this s#$t.
Related
I tried doing a clean build, uninstalling/reinstalling pods, not too sure where to go to next.
I never received this error before, but I first got it when I tried integrating Firebase into my project. I made sure to add all of the correct pods, I then went ahead and added a few other Firebase pods, just in case. I'm not sure if it has anything to do with this, but here is what my pods file looks like.
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Effortflex' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
use_modular_headers!
# Pods for Effortflex
pod 'RealmSwift'
pod 'IQKeyboardManagerSwift'
pod 'Firebase'
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'FirebaseFirestoreSwift'
end
Here is a sample of the error...
/Users/owner1/Library/Developer/Xcode/DerivedData/Effortflex-bmtqbbukvlosxpbraqoiwplpcfyj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/pb_encode.o
duplicate symbol '_pb_encode_fixed32' in:
/Users/owner1/Library/Developer/Xcode/DerivedData/Effortflex-bmtqbbukvlosxpbraqoiwplpcfyj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/pb_encode 2.o
/Users/owner1/Library/Developer/Xcode/DerivedData/Effortflex-bmtqbbukvlosxpbraqoiwplpcfyj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/pb_encode.o
ld: 34 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any help would be greatly apprecaited!
Something that helped me was to the following -
In terminal navigate to your project folder
Run 'pod deintegrate'
Run 'pod install'
After that my project was able to compile. Hope that works for you!
I have a MyApp.xcodeworkspace that uses a homegrown MyAppKit iOS framework.
MyAppKit is included as xcodeproject inside the parent MyApp project.
When I include Firebases and Google Tag Manager via Cocoapods in MyAppKit framework and compile the parent project, I get this error.
ld: framework not found Pods_MyAppKit
and a bunch of warnings:-
ld: warning: directory not found for option '-F/Users/this.user/Library/Developer/Xcode/DerivedData/MyApp-enzvpdzsyhjszqbnwiclnpszlyri/Build/Products/Debug-iphonesimulator/FirebaseCore'
ld: warning: directory not found for option '-F/Users/this.user/Library/Developer/Xcode/DerivedData/MyApp-enzvpdzsyhjszqbnwiclnpszlyri/Build/Products/Debug-iphonesimulator/FirebaseInstanceID'
ld: warning: directory not found for option '-F/Users/this.user/Library/Developer/Xcode/DerivedData/MyApp-enzvpdzsyhjszqbnwiclnpszlyri/Build/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: warning: directory not found for option '-F/Users/this.user/Library/Developer/Xcode/DerivedData/MyApp-enzvpdzsyhjszqbnwiclnpszlyri/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'
ld: warning: directory not found for option '-F/Users/this.user/Library/Developer/Xcode/DerivedData/MyApp-enzvpdzsyhjszqbnwiclnpszlyri/Build/Products/Debug-iphonesimulator/GoogleUtilities'
ld: warning: directory not found for option '-F/Users/this.user/Library/Developer/Xcode/DerivedData/MyApp-enzvpdzsyhjszqbnwiclnpszlyri/Build/Products/Debug-iphonesimulator/Protobuf'
ld: warning: directory not found for option '-F/Users/this.user/Library/Developer/Xcode/DerivedData/MyApp-enzvpdzsyhjszqbnwiclnpszlyri/Build/Products/Debug-iphonesimulator/nanopb'
Background...
Came the need to import Firebase and Google Tag Manager as Cocoapods in MyAppKit framework.
I've done the required pod init, pod install in MyAppKit without any errors.
MyAppKit.xcworkspace on its own builds and compiles successfully.
The Podfile in MyAppKit looks like this:-
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
target 'MyAppKit' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyAppKit
pod 'Firebase/Core', '~> 5.19'
pod 'Firebase/ABTesting'
pod 'Firebase/Performance'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Analytics'
pod 'GoogleTagManager', '~> 7.1'
pod 'Google-Mobile-Ads-SDK'
end
I expect there to be minimal changes to the parent project and ideally don't want to include the same Pods (as in the framework MyAppKit) in the main project as well.
Is there anything incorrect in the way I'm including the Pods in MyAppKit framework.
Is there something additional that I need to do in my parent project MyApp to make this work ?
Thanks,
Tas
I have added Braintree with other lib using pods. My build is failed because it can't find library for Braintree. Here's what I have:
ld: library not found for -lBraintree
clang error: linker command failed with exit code 1 (use -v to see
invocation)
Things I've tried:
Used .xcworkspace instead of .xcodeproj
Set build active architecture NO
Removed any red lib.a
This is what my project looks like:
I don't see a -lBraintree flag in the last picture yet it shows here -ObjC -ObjC -l"AdIdAccessLibrary" -l"Braintree" -l"DI... why?
Podfile
target 'MyProject' do
pod 'Braintree', '3.9.3'
pod 'Google/Analytics', '~> 1.0.0'
pod 'GoogleIDFASupport'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
pod 'GoogleMaps'
end
target 'MyProjectTests' do
end
I had a project that was working fine and I decided to update cocoapods. I ran
pod install after cocoapods updated, and now I'm getting this error:
ld: library not found for -lStripe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I know this is a common cocoapods error/problem. I've scoured the internet for the last 12 hours trying every possible solution. Things I've done:
Made sure I'm opening the workspace
Reinstalled cocoapods
Downgraded cocoapods to a previous version (to 0.33.1)
Ran deintegrate and removed cocoapods
Reinstalled cocoapods again
Made sure Build Active Architecture Only is set to NO on both Pod and Target
Tried many variations for Other Linker Flags (see below for current setup)
My Framework Search Paths and Library Search Paths each start with $(inherited)
Other Linker Flags
$(inherited)
-framework
"CoreGraphics"
-framework
"Foundation"
-framework
"MobileCoreServices"
-framework
"Security"
-framework
"SystemConfiguration"
Sometimes, with the above Linker Flags, if I rerun pod install I get a bunch of arm64 errors which can only be solved by adding this to the linkers:
-l"Pods-Buyer-AFNetworking"
-l"Pods-Buyer-Stripe"
-l"Pods-Buyer-RKNotificationHub"
-l"Pods-Buyer-RKDropdownAlert"
-l"Pods-Buyer-SVProgressHUD"
I've also tried combinations of adding/removing this from the Linker Flags:
-ObjC
-lc++
-all_load
And finally, here's my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
target 'Buyer' do
pod 'AFNetworking', '2.2.1'
pod 'Stripe'
# pod 'PaymentKit'
pod 'RKNotificationHub'
pod 'RKDropdownAlert'
pod 'SVProgressHUD'
# pod 'Reveal-iOS-SDK', :configurations => ['Debug']
end
target 'BuyerTests' do
end
I've also followed all of the steps on the CocoaPods Guides Troubleshooting page (specifically 'Using the CocoaPods Project' > Step 4). That didn't change anything.
Is there anything I'm missing? This is driving me crazy... I'm at wits end. Any advice or things I'm missing would be really appreciated! (Oh and I'm running the latest Xcode version)
Thank you all in advanced!
I cannot compile my Xcode project, it has problems with duplicate ParseFacebookUtilsV4
this is my apple Mach-O Linker Error:
duplicate symbol _llvm.cmdline in:
/directory/Pods/ParseFacebookUtilsV4/libParseFacebookUtilsV4Lib.a(PFFacebookAuthenticationProvider.o)
/directory/Pods/ParseFacebookUtilsV4/libParseFacebookUtilsV4Lib.a(PFFacebookUtils.o)
duplicate symbol _llvm.embedded.module in:
/directory/Pods/ParseFacebookUtilsV4/libParseFacebookUtilsV4Lib.a(PFFacebookAuthenticationProvider.o)
/directory/Pods/ParseFacebookUtilsV4/libParseFacebookUtilsV4Lib.a(PFFacebookUtils.o)
ld: 2 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've imported ParseFacebookUtilsV4 with cocoapods, here is my Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
use_frameworks!
target 'ZZZ' do
pod 'Parse'
pod 'FBSDKCoreKit', '4.3.0'
pod 'FBSDKLoginKit', '4.3.0'
pod 'ParseFacebookUtilsV4'
end
target 'ZZZTests' do
end
And here is my bridging header:
#ifndef FarThings_FarThings_Bridging_Header_h
#define FarThings_FarThings_Bridging_Header_h
#import <Parse/Parse.h>
#import <ParseFacebookUtilsV4/PFFacebookUtilsV4.h>
#import "FBSDKCoreKit.h"
#import "FBSDKLoginKit.h"
#import <Bolts/BFTask.h>
#endif
I hit this before, In my case I upgrade from old version and here's how I fix it. (Main idea is cleanup everything before pod)
Remove all old Parse, Bolt and Facebook related (all .framework lookup path and embed .framework) until you end up with unknown class.
Remove all .framework form folder via finder.
Clean up your build folder by 'alt+clean' via Xcode.
Delete all Pod related include all Pod folder via finder.
try pod install one by one (or all at one if you feeling brave) until it look like this.
pod 'Parse'
pod 'ParseFacebookUtilsV4'
pod 'ParseCrashReporting'
and some other pod you need after that.
It work for me, just make sure you remove all related.
You can this pod with new project to prove this work before trying with real project.