ParseFacebookUtilsV4 duplicate symbols for architecture armv7 - ios

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.

Related

IOS app wouldn't launch due to error "ld: 34 duplicate symbols for architecture x86_64"

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!

Framework not found error when using Cocoapods in a framework inside parent project

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

ld: library not found for -lCocoaLumberjack

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.

"framework not found AFNetworking for architecture arm64" for my Test Target

This is what I see when trying to run tests under test target in my iOS App:
ld: framework not found AFNetworking for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is how my podfile looks like:
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "8.2"
def pods
pod 'AFNetworking'
pod 'Fabric'
pod 'Crashlytics'
pod 'MagicalRecord'
pod 'SDWebImage'
pod 'SVProgressHUD'
end
target 'MySoberRoomMate' do
pods
end
inhibit_all_warnings!
I am new on IOS development and did not have the required reputation to add comment so that I am posting answer.
I did a little work with pod file and i think the pods for the test target is not added in pod file so that the compiler showing the error.
do some thing like this in the pod file for the test target
target 'TestTarget' do
pods
end
add your test target name in place of 'TestTarget'
Hope it works.

Library not found for -lBraintree

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

Resources