After the last pod update, project refuses to build with the following error
Undefined symbols for architecture x86_64:
"_kAPMSafelistedEventsOptionKey", referenced from:
+[FIRAnalytics startWithConfiguration:options:] in FirebaseAnalytics(FIRAnalytics_ca9cdf99cfbae2f51d040b73dd242e94.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
my current podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# Uncomment this line if you're using Swift
use_frameworks!
project 'PROJECT'
target 'PROJECT' do
pod 'Firebase/Core'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'MWPhotoBrowser', '~> 1.4'
pod 'AKNumericFormatter', '~> 0.0'
pod 'GoogleMaps', '~> 1.10'
pod 'GoogleAnalytics', '~> 3.13'
pod 'Fabric'
pod 'Crashlytics'
pod 'LMGeocoder', '~> 1.0'
pod 'AFNetworking', '~> 3.0'
pod 'JSONModel'
end
I've tried all the usual approaches to these xcode anomalies (removing derived data, restarting, updating pods, reinstalling pods, using older versions and plenty of other SO suggested fixes) and none of it helped. What could be the cause for this?
Related
I am trying to build a project that was developed around sept 2015. Getting the following error when run on device,
ld: library not found for -lPods
clang: error: linker command failed with exit code 1
I have Podfile.lock which has the version of the libs was being used back then. But I am using latest Cocoapods (v 1.21.1). Assuming this could the problem, I installed Cocoapods (v 0.39.0) that was the version back then. But having following error,
[!] Unable to load a specification for plugin `/Library/Ruby/Gems/2.0.0/gems/cocoapods-deintegrate-1.0.1`
Updating local specs repositories
[!] The `master` repo requires CocoaPods 1.0.0 - (currently using 0.39.0)
Update CocoaPods, or checkout the appropriate tag in the repo.
So I installed CocoaPods (v 1.0.0) but getting the same error,
ld: library not found for -lPods
clang: error: linker command failed with exit code 1
Any help is appreciated. Thanks!
Update
Here is the podfile content,
platform :ios, '7.0'
# source 'git#bitbucket.org:****dev/****-ios-spec-pod.git'
source 'https://github.com/CocoaPods/Specs.git'
#source 'https://bitbucket.org/****dev/****-ios-spec-pod.git'
# to test Pod :path => '~/Documents/...'
xcodeproj '****/****.xcodeproj'
# ignore all warnings from all pods
inhibit_all_warnings!
target "****" do
pod 'SVProgressHUD'
pod 'AFNetworkActivityLogger'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'APAvatarImageView'
pod '****-iOS-SDK-API', :path => '~/Documents/****_dev/****-ios-sdk-api-pod'
pod 'PSAlertView'
pod 'UITextField+Shake'
pod 'HexColors', '~> 2.2.1'
pod 'TSMessages'
pod 'TPKeyboardAvoiding'
pod 'DateTools'
pod 'SDWebImage'
pod 'PureLayout'
pod 'SZTextView'
pod 'ALAssetsLibrary-CustomPhotoAlbum', '~> 1.3'
pod 'UIActionSheet-Blocks', '~> 1.0'
pod 'DTPickerPresenter', '~> 0.2.0'
pod 'CCMPopup'
pod 'FranklySDK'
pod 'Instabug'
pod 'MZTimerLabel'
pod 'Google/Analytics'
end
Here, **** = My project name
This is not the regular duplicate symbols error. I am using AFNetworking library for networking with cocoa pods. I also using a third party framework that has been added to the target "Link Binary With Libraries" list in build phases section.
Unfortunately, This third party framework includes the AFNetworking that apparently is being used by it for networking.
Therefore, it makes sense that this error has been produced. Any idea how can this be solved?
Edit: Here it shows that kAFUploadStream3GSuggestedPacketSize symbol is defined in the afnetworking and in the OPPWAMobile framework. along with another 59 symbols.
duplicate symbol _kAFUploadStream3GSuggestedPacketSize in:
/Users/khaled/Library/Developer/Xcode/DerivedData/Saveto-fhceqhysbolbskawabayohjbtsra/Build/Products/Debug-iphonesimulator/AFNetworking/libAFNetworking.a(AFURLRequestSerialization.o)
/Users/khaled/Development/iOS/Saveto/git#git.assembla.com:imena-develotpment-.29/OPPWAMobile.framework/OPPWAMobile
ld: 60 duplicate symbols for architecture x86_64 clang: error: linker
command failed with exit code 1 (use -v to see invocation)
Podfile:
platform :ios, '7.1'
source 'https://github.com/CocoaPods/Specs.git'
target 'Saveto' do
pod 'SWTableViewCell', '~> 0.3.7'
pod 'CocoaLumberjack', '~> 2'
pod "AFNetworking" , '~> 2'
pod 'SDWebImage', '~>3.7'
pod 'MMDrawerController', '~> 0.6.0'
pod 'iRate'
pod 'XLForm'
pod "SwipeView", "~>1.3.2"
pod "DAAlertController"
pod "Mantle" , "~>2.0.4"
pod 'pop', '~> 1.0'
pod 'GoogleMaps', '~> 1.12'
pod 'SVProgressHUD'
pod 'FXBlurView'
pod 'Fabric'
pod 'Crashlytics'
end
You are correct about the Pod import of AFNetworking clashing with the 3rd party library which happens to contain the same symbols. There are are couple of ways to resolve it, the best and most sensible one would be to specify use_frameworks! in your Podfile:
platform :ios, '9.0'
use_frameworks!
target 'Saveto' do
pod 'SWTableViewCell', '~> 0.3.7'
pod 'CocoaLumberjack', '~> 2'
pod 'AFNetworking' , '~> 2'
pod 'SDWebImage', '~>3.7'
pod 'MMDrawerController', '~> 0.6.0'
pod 'iRate'
pod 'XLForm'
pod 'SwipeView', '~>1.3.2'
pod 'DAAlertController'
pod 'Mantle' , '~>2.0.4'
pod 'pop', '~> 1.0'
pod 'GoogleMaps', '~> 1.12'
pod 'SVProgressHUD'
pod 'FXBlurView'
pod 'Fabric'
pod 'Crashlytics'
end
I suppose you could also rename the symbols with a post_install method, although that might not resolve everything; there shouldn't be any issues after using the method above though.
I have an iOS project which uses Firebase and Google Toolbox for Mac, which are added via Pods. My Podfile is as follows:
target 'MyApp' do
pod 'GoogleToolboxForMac', '~> 2.1'
pod 'GTMSessionFetcher', '~> 1.1'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
end
When I build the project in Xcode I get this error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GTMLogger", referenced from:
objc-class-ref in FirebaseMessaging(GIPReachability_ae5504e4a6a28a1d8997c6f38e8bff8b.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can anyone advise? Judging from other similar questions I may need import a framework in Linked Frameworks and Libraries. I've added UserNotifications.framework for Firebase Messaging, but not sure what else I'd need...?
Looks like you need to add another Cocoapod to your Podfile:
target 'MyApp' do
pod 'GoogleToolboxForMac', '~> 2.1'
pod 'GTMSessionFetcher', '~> 1.1' # version 1.1 & newer up to - but not including - 2.0
pod 'gtm-logger', '>= 0.0.5' # version 0.0.5 or newer
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
end
and then run pod update
After updating Xcode7 to Xcode 3 and migrate my code to swift 3, pods stopped working and show the following error.
ld: library not found for -lAFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I made sure the app is opened from the right icon.
I removed Afnetworking from Pods so it show same error in another one and so on.
I make sure the bit_enabled is set to yes.
I deleted the pod file, and workspace, everything related to pod and start over, same issue.
I edited the scheme and nothing too.
I removed and added $(inherited) again but nothing.
removed Xcode and installed it again
made sure the Xcode is looking to Xcode 8 commas line.
the cocoa pod version is cocoapods-1.2.0.beta.3
also here is the pods file
target 'MondoTaxiClient' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
#use_frameworks!
pod 'SocketRocket’, '~> 0.4'
pod 'GoogleMaps', '~> 1.10.5'
pod 'FBSDKCoreKit', '~> 4.9'
pod 'FBSDKLoginKit', '~> 4.9'
pod 'Parse'
pod 'SDWebImage', '~>3.7'
# pod 'Fabric', '~> 1.6'
pod 'Fabric'
pod 'Digits'
pod 'TwitterCore'
pod 'Crashlytics'
pod 'APAddressBook/Swift', '~> 0.2'
pod 'ActionSheetPicker-3.0', '~> 2.0.3'
pod 'Mixpanel', '~> 2.9'
pod 'Branch'
pod 'Adjust', '~> 4.6.0'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
pod 'AFNetworking', '~> 3.1'
end
the code target was iOS 7 + but after xcode 8 i made it iOS8+
if the solution is by downgrade cocoa pods please let me know which version.
some of the pods are conflicting with some of the static SDKs, frameworks once the conflict is resolved the issue disappear
I just upgraded Cocoapods and ran a pod install. after doing a hard clean and build I'm getting the following error:
ld: library not found for -lPods-HHRouter clang: error:
linker command failed with exit code 1 (use -v to see invocation)
I tried removing every reference to HHRouter and pulling the pod. It moved on to give me an error about another pod.
Here is what my podfile looks like:
platform :ios, '8.0'
# ignore all warnings from all pods
inhibit_all_warnings!
pod 'JDStatusBarNotification'
pod 'HHRouter', '~> 0.1'
pod 'ViewDeck', '2.2.11'
pod 'IQKeyboardManager'
pod 'MagicalRecord'
pod 'RSKImageCropper', '1.0.0'
pod 'UICollectionViewLeftAlignedLayout'
pod 'FLAnimatedImage', '~> 1.0'
pod 'CRToast', '~> 0.0.7'
pod 'SDWebImage', '~>3.7'
Am I missing anything?
I deleted all the settings behind Other Linker Flags, except $(inherited), and it went well.