Installed CocoaPods and Braintree now my project won't build - swift

Ld /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator/Podding.app/Podding normal x86_64
cd /Users/admin/Development/zift/Podding
export IPHONEOS_DEPLOYMENT_TARGET=8.4
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -L/Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator -L/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK -F/Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator -filelist /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Intermediates/Podding.build/Debug-iphonesimulator/Podding.build/Objects-normal/x86_64/Podding.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lBraintree -lPayPalMobile-BT -lc++ -framework AVFoundation -framework Accelerate -framework AddressBook -framework AudioToolbox -framework CoreLocation -framework CoreMedia -framework MessageUI -framework MobileCoreServices -framework SystemConfiguration -framework UIKit -weak_framework PassKit -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Intermediates/Podding.build/Debug-iphonesimulator/Podding.build/Objects-normal/x86_64/Podding.swiftmodule -mios-simulator-version-min=8.4 -lPods -Xlinker -dependency_info -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Intermediates/Podding.build/Debug-iphonesimulator/Podding.build/Objects-normal/x86_64/Podding_dependency_info.dat -o /Users/admin/Library/Developer/Xcode/DerivedData/Podding-ffudeqoeybkocbevxvjrdlvtdswc/Build/Products/Debug-iphonesimulator/Podding.app/Podding
duplicate symbol _llvm.cmdline in:
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PPZebraAnalyticsWidgetCategories.o)
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PP2FAViewController.o)
duplicate symbol _llvm.embedded.module in:
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PPZebraAnalyticsWidgetCategories.o)
/Users/admin/Development/zift/Podding/Pods/Braintree/Braintree/PayPal/mSDK/libPayPalMobile-BT.a(PP2FAViewController.o)
Those last 2 "duplicate" lines repeat about a hundred times then this error
ld: 250 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I installed exactly how the CocoaPods site says. Using Xcode6 with swift. I tried a bridging header still no success. I tried using a brand new project as well same results. What am I missing?

I solved this by changing the build settings. Click the root of your project in Xcode and then view Build Settings. Navigate to Linking and make sure you are showing "ALL" settings (top right area of build settings window). Then remove Obj C from 'Other Linker Flags' as well as a setting $inherited. I was able to clean and build. Hope this helps. I saw this answer somewhere else but I didnt figure it out since they didn't have the $inherited flag removed.

Related

ld: library not found for -lc++ clang: error: linker command failed with exit code 1 (use -v to see invocation)

This showed when I am running the app with connected device:
Ld DerivedData/TestPods/Build/Products/Debug-iphoneos/TestPods.app/TestPods normal arm64
cd /Users/tannaz/Developments/TestPods
export IPHONEOS_DEPLOYMENT_TARGET=9.3
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -L/Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Products/Debug-iphoneos -L/Users/tannaz/Developments/TestPods/Pods/GGLInstanceID/Libraries -L/Users/tannaz/Developments/TestPods/Pods/Google/Libraries -L/Users/tannaz/Developments/TestPods/Pods/GoogleCloudMessaging/Libraries -F/Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Products/Debug-iphoneos -F/Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Products/Debug-iphoneos/Alamofire -F/Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Products/Debug-iphoneos/JTFadingInfoView -F/Users/tannaz/Developments/TestPods/Pods/GoogleIPhoneUtilities/Frameworks -F/Users/tannaz/Developments/TestPods/Pods/GoogleInterchangeUtilities/Frameworks -F/Users/tannaz/Developments/TestPods/Pods/GoogleNetworkingUtilities/Frameworks -F/Users/tannaz/Developments/TestPods/Pods/GoogleSymbolUtilities/Frameworks -F/Users/tannaz/Developments/TestPods/Pods/GoogleUtilities/Frameworks -filelist /Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Intermediates/TestPods.build/Debug-iphoneos/TestPods.build/Objects-normal/arm64/TestPods.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -rpath -Xlinker #loader_path/Frameworks -Xlinker -rpath -Xlinker #executable_path/Frameworks -miphoneos-version-min=9.3 -dead_strip -Xlinker -no_deduplicate -ObjC -lGGLCloudMessaging -lGGLCore -lGGLInstanceIDLib -lGcmLib -lsqlite3 -lstdc++ -lz -framework AddressBook -framework Alamofire -framework AssetsLibrary -framework CoreFoundation -framework CoreGraphics -framework CoreLocation -framework CoreMotion -framework GoogleIPhoneUtilities -framework GoogleInterchangeUtilities -framework GoogleNetworkingUtilities -framework GoogleSymbolUtilities -framework GoogleUtilities -framework JTFadingInfoView -framework MessageUI -framework Security -framework SystemConfiguration -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Intermediates/TestPods.build/Debug-iphoneos/TestPods.build/Objects-normal/arm64/TestPods.swiftmodule -framework Pods_TestPods -Xlinker -dependency_info -Xlinker /Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Intermediates/TestPods.build/Debug-iphoneos/TestPods.build/Objects-normal/arm64/TestPods_dependency_info.dat -o /Users/tannaz/Developments/TestPods/DerivedData/TestPods/Build/Products/Debug-iphoneos/TestPods.app/TestPods
ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You had this error because of some missing libraries in your project. Check your Build Phases then Link Binary With Libraries. The linker can't find some frameworks that may be moved or deleted.
Add the missing libraries. Clean and Build your project.
Check these related tickets:
Xcode 5- clang: error: linker command failed with exit code 1 (use -v to see invocation)
Xcode 7: linker command failed with exit code 1 (use -v to see invocation) again
To solve this problem:
Go to your project setting page
Select your project (left side)
Click the "Build Settings" tab
Search "Bitcode"
Set "Enable Bitcode" to "No"
Hope this helps!

ld: library not found for -lAfariaSLL

Full error message:
Ld/Users/chairman/Library/Developer/Xcode/DerivedData/Field_Final-dsxytmugnwuntcglfimizlbtmegi/Build/Products/Debug-iphonesimulator/Field_Final.app/Field_Final normal i386
cd "/Users/chairman/Documents/Vitthal/NEWFSNOV21_2.3/FSDEVICE2.3 dec6/Field_Final"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Users/chairman/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/chairman/Desktop/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/chairman/Desktop/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Users/chairman/Desktop/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/chairman/Library/Developer/Xcode/DerivedData/Field_Final-dsxytmugnwuntcglfimizlbtmegi/Build/Products/Debug-iphonesimulator -F/Users/chairman/Library/Developer/Xcode/DerivedData/Field_Final-dsxytmugnwuntcglfimizlbtmegi/Build/Products/Debug-iphonesimulator -filelist /Users/chairman/Library/Developer/Xcode/DerivedData/Field_Final-dsxytmugnwuntcglfimizlbtmegi/Build/Intermediates/Field_Final.build/Debug-iphonesimulator/Field_Final.build/Objects-normal/i386/Field_Final.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Objc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework MapKit -framework CoreLocation -lz.1.2.5 -lstdc++.6 -licucore.A -framework AddressBook -framework CoreFoundation -framework CFNetwork -framework Security -framework MobileCoreServices -framework SystemConfiguration -framework MessageUI -framework UIKit -framework Foundation -framework CoreGraphics -lAfariaSLL -lMAKit -lsupUltralite -lsupcore -lSUPObj -lclientrt -lDatavault -lMO -o /Users/chairman/Library/Developer/Xcode/DerivedData/Field_Final-dsxytmugnwuntcglfimizlbtmegi/Build/Products/Debug-iphonesimulator/Field_Final.app/Field_Final
ld: library not found for -lAfariaSLL
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Go to your target. Under build settings, search for "library search paths". There you should list all the directories where your linked libraries are located.
In respect to SUP, read here about the project settings: http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01213.0225/doc/html/aro1369255660920.html. The link is for v2.2.5, you can select on the left your version and find the document there.
Try this :
Go to targets -> Build phases -> Link Binary With Libraries
Click on + symbol
Press Add Other & add your library
Clean project & than run

IOS: Library not found for -lz.1.2.3

I don't understand my error:
Ld
Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/Test.app/Test
normal i386
cd /Users/lol/Desktop/Test
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2
-arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
-L/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator
-L/Users/lol/Desktop/Test -F/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator
-filelist /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Intermediates/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/i386/Test.LinkFileList
-mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -lextThree20JSON+SBJSON /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UICommon.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UINavigator.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Core.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UI.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Network.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Style.a
-framework SystemConfiguration -framework MobileCoreServices -framework CFNetwork -framework AddressBook -framework AddressBookUI -framework QuartzCore -framework UIKit -framework Foundation -framework MessageUI -framework CoreGraphics -lz.1.2.3 -lxml2.2.7.3 -o /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/Test.app/Test
ld: library not found for -lz.1.2.3
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
Can you help me to understand this?
Thanks a lot ;)
The option -lz.1.2.3 means that the compiler is attempting to link the file libz.1.2.3.a, libz.1.2.3.so, or libz.1.2.3.dylib. It cannot find any of these variations and is failing because of that.
You can attempt to find the location of this file and include it in your library include path.
My question is why are you linking a specific version of z lib? Usually, it's good enough to just have -lz or -llibz.dylib. Do you have a reason for picking a specific version? What happens when you link using the un-versioned name.
Just use -lz, there's no need to use the versioned link to it. So remove libz-1.2.3.tbd from frameworks and add libz.tbd.
In the project navigator, select your project.
Select your target.
Select the "Build Phases" tab.
Open "Link Binaries With Libraries" expander.
Remove libz-1.2.3.tbd
Click the + button.
Add libz.tbd

Two same file names in Xcode project

I'm trying to create a project utilizing both MailChimp and ShareKit code.
I believe I'm dynamically linking to them both by dragging their Xcode project files into my new project, then dragging and dropping the desired groups.
The problem I'm having now is that they both use a file name called SBJSonParser from their JSON libraries.
I'm getting an error that says:
ld: duplicate symbol _OBJC_CLASS_$_SBJsonParser
I don't want / don't think renaming the files would be sufficient, as there are quite a few more filenames they have in common. Does anyone have ideas on what to do? Thanks
Full error:
Ld /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Products/Debug-iphonesimulator/PolaroidMe.app/PolaroidMe normal i386
cd /Users/user/Documents/PolaroidMe
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Products/Debug-iphonesimulator -F/Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Products/Debug-iphonesimulator -filelist /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Intermediates/PolaroidMe.build/Debug-iphonesimulator/PolaroidMe.build/Objects-normal/i386/PolaroidMe.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework CoreLocation -framework Twitter -framework CFNetwork -framework SystemConfiguration -framework Security -framework MessageUI -framework AVFoundation -framework MobileCoreServices -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Products/Debug-iphonesimulator/PolaroidMe.app/PolaroidMe
ld: duplicate symbol _OBJC_CLASS_$_SBJsonParser in /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Intermediates/PolaroidMe.build/Debug-iphonesimulator/PolaroidMe.build/Objects-normal/i386/SBJsonParser-7C0C46CE63D45CA3.o and /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Intermediates/PolaroidMe.build/Debug-iphonesimulator/PolaroidMe.build/Objects-normal/i386/SBJsonParser-227BA1E6AFC01E91.o for architecture i386
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
ld: duplicate symbol _OBJC_CLASS_$_SBJsonParser in /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Intermediates/PolaroidMe.build/Debug-iphonesimulator/PolaroidMe.build/Objects-normal/i386/SBJsonParser-7C0C46CE63D45CA3.o and /Users/user/Library/Developer/Xcode/DerivedData/PolaroidMe-gvmchgayobqfebhcnhfwhxoueaeo/Build/Intermediates/PolaroidMe.build/Debug-iphonesimulator/PolaroidMe.build/Objects-normal/i386/SBJsonParser-227BA1E6AFC01E91.o for architecture i386
SBJSON is a library, it only needs to be inside your project once. Just delete one of them.

MGTwitterEngine throws error: g++-4.2 failed with exit code 1

I installed MGTwitterEngine in my iPhone app, and followed all the instructions, and now I get the following error:
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 failed with exit code 1
The full error text is:
Ld /Users/jason/Documents/iPad/build/Debug-iphonesimulator/FlashCards.app/FlashCards normal i386
cd /Users/jason/Documents/iPad/FlashCards
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -L/Users/jason/Documents/iPad/build/Debug-iphonesimulator -L/Users/jason/Documents/iPad/FlashCards/Classes -L/Users/jason/Documents/iPad/FlashCards/Classes/SAOAuthTwitterEngine -L/Users/jason/Documents/iPad/FlashCards/Classes -L/Users/jason/Documents/iPad/FlashCards/Classes/Simulator4 -F/Users/jason/Documents/iPad/build/Debug-iphonesimulator -filelist /Users/jason/Documents/iPad/build/FlashCards.build/Debug-iphonesimulator/FlashCards++.build/Objects-normal/i386/FlashCards.LinkFileList -mmacosx-version-min=10.6 -l teEngine -ObjC -all_load -Xlinker -objc_abi_version -Xlinker 2 /Users/jason/Documents/iPad/core-plot/build/Debug-iphonesimulator/libCorePlot-CocoaTouch.a -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreData -licucore.A -framework QuartzCore -framework SystemConfiguration -framework Security -framework MessageUI -framework CFNetwork -framework AddressBook -framework AddressBookUI -framework AudioToolbox -lteEngine -lteEngine -lOAuth -lxml2.2.7.3 -o /Users/jason/Documents/iPad/build/Debug-iphonesimulator/FlashCards.app/FlashCards
ld: duplicate symbol _EstimateBas64DecodedDataSize in /Users/jason/Documents/iPad/FlashCards/Classes/SAOAuthTwitterEngine/libOAuth.a(Base64Transcoder.o) and /Users/jason/Documents/iPad/build/FlashCards.build/Debug-iphonesimulator/FlashCards++.build/Objects-normal/i386/Base64Transcoder.o
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 failed with exit code 1
Any idea what could be causing it?
Linker found a duplicate symbols for EstimateBas64DecodedDataSize function because in you project you are trying to link against static library libOAuth.a and Base64Transcoder.o which was built from the sources. Both of them contains this symbol and linker doesn't know which one it should pick. It's hard to tell how to resolve this issue in general case, but basically you have to make sure that this symbol is exported by exactly one file from linker's input.
Where did you get this MGTwitterEngine distribution? It will be much easier to solve this issue with actual code.