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.
Related
I am facing an issue wherein I needed to use FirebaseRemoteConfig for my iOS app. I included the following pod:
pod 'Firebase/RemoteConfig'
Now when I am running the command on terminal:
pod install
It shows me the error:
Framework not found 'Protobuf'
Its really frustrating as the project was running fine before this. I have tried some suggestions from stack overflow but could not resolve the issue.
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# ignore all warnings from all pods
inhibit_all_warnings!
use_frameworks!
target 'S****k' do
pod 'AFNetworking', '~> 2.6'
pod 'TPKeyboardAvoiding', '~> 1.2'
pod 'SVProgressHUD', '~> 1.1'
pod 'Google/SignIn'
pod 'Mantle', '~> 2.0'
pod 'FBSDKCoreKit'#, '~> 4.8'
pod 'FBSDKLoginKit'#, '~> 4.8'
pod 'GooglePlaces', '~> 3.0.0'
#pod 'Firebase/Core'
pod 'GoogleTagManager'
pod 'GoogleIDFASupport'
pod 'Fabric'
pod 'Crashlytics'
pod 'AppsFlyerFramework'
pod 'KissXML'
pod 'GoogleMaps', '~> 3.0.0'
pod 'AutoScrollLabel'
pod "CleverTap-iOS-SDK"
pod 'IQKeyboardManager'
pod 'TrueSDK'
pod 'HyperSDK', '0.2.90'
pod 'ExpressCheckout'
#pod "AlignedCollectionViewFlowLayout"
pod 'UICollectionViewLeftAlignedLayout'
#pod 'TGLParallaxCarousel'
pod "JuspaySafeBrowser"
pod 'Firebase/RemoteConfig'
PLEASE BACKUP YOUR PROJECT
Let's go to "Your Project" -> Build Settings
find here Find here "Other Linker Flags" and open it
delete (click on "-" sign) string "Protobuf" and string "framework" above "Protobuf"
clean build Folder (Command + SHIFT + K) and rebuild
that's all
Select Project target
Go to build phases
Search Protobuf
delete Protobuf framework
Clean build folder and then build
It is worked for me
Worked for me
delete pods
delete .symlinks
flutter clean
flutter run
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?
I have the below Podfile.
target '*****' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for *****
# pod 'Netcore-Smartech-iOS-SDK'
pod 'TPKeyboardAvoiding'
pod 'AMSlideMenu', '~> 1.5.4'
pod 'SVProgressHUD'
pod 'Google/SignIn'
pod 'Google/Analytics'
pod 'MZFormSheetController'
pod 'AFNetworking'
pod 'Fabric'
pod 'Crashlytics'
pod 'LTHMonthYearPickerView'
target '****CabsTests' do
inherit! :search_paths
# Pods for testing
end
target '***CabsUITests' do
inherit! :search_paths
# Pods for testing
end
#pod 'AFNetworking', '~> 2.5.4'
end
Its working fine ,
But when I start importing the below , it give me error:
"
Showing Recent Messages
: Library not found for -lAFNetworking
: Linker command failed with exit code 1 (use -v to see invocation)"
use_frameworks!
pod 'MapboxNavigation', '~> 0.6.0'
pod 'TPKeyboardAvoiding'
pod 'AMSlideMenu', '~> 1.5.4'
pod 'SVProgressHUD'
pod 'Google/SignIn'
pod 'Google/Analytics'
pod 'MZFormSheetController'
pod 'AFNetworking'
pod 'Fabric'
pod 'Crashlytics'
pod 'LTHMonthYearPickerView'
Please suggest what make me wrong.
The linker flag has been renamed to:
-lAFNetworking
but the Cocoapods settings have not been updated yet. Rename the entry in "Other Linker Flags" and your problem will be solved.
Also, the library does not support Bitcode yet, thus please turn off Bitcode in Build Options > Enable Bitcode > Select "No". Clean & Rebuild afterwards.
You should add 'https://github.com/CocoaPods/Specs.git'.
Like this:
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
target 'ProjectName' do
pod 'AFNetworking', '~> 3.0'
# Pods for ProjectName
end
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 can compile the target with debug configuration, but when change to release configuration, it failed with error:
ld: framework not found Pods_MyTarget
this is the pod file:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'SnapKit', '~> 0.15.0'
pod 'ObjectMapper', '~> 0.19'
pod 'Nuke'
pod 'Nuke-Alamofire-Plugin'
pod 'RESideMenu', '~> 4.0.7'
pod 'XCGLogger', '~> 3.0'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'TTTAttributedLabel'
pod 'UIColor_Hex_Swift', '~> 1.4'
pod 'RxSwift', '~> 2.0.0-beta'
pod 'RxCocoa', '~> 2.0.0-beta'
pod 'RxBlocking', '~> 2.0.0-beta'
I have seen this bug many a times. I do the below workaround, this may not be the right fix.
Go to Project settings and change "Build Active Architecture Only" to "NO".
I found that I have to change the pod file to something like this:
link_with 'xxx'
target xxx do
pod xxxxxx
end
and then delete some files generated by pod manually, seems pod cannot delete them, such as the xcconfig, framework, .etc
then run 'pod install'
it works.