weird error when trying to install ParseUI via CocoaPods - ios

I'm trying to build an App using Parse as my backend and Xcode 7.0 & Swift 2. So in order to use PFQueryTableView, I need to use CocoaPods to install ParseUI first. I did this and used .xcworkspace to re-enter the project and then tried to compile and run it. But instantly I got this very nasty error:
ld: 823 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
These 2 lines are just the bottom 2 lines of the error messages, because there are a lot and they all start with something like:
duplicate symbol _OBJC_METACLASS_$_PFUserFileCodingLogic in:
or anything like that
I have many frameworks installed like Bolts, and it seems not a lot of people get this like me.

I had this same issue. I'd both installed Parse via Pods as well as by dragging the libraries into my Frameworks directory manually.
I removed the Pods directory and everything that said Pods from my app's build phases and it seemed to work out.

Related

iOS firebase Mach-O Linker Error without cocapods

I'm trying to import Firebase into my iOS app. I followed this tutorial for doing this manually with Objective-C (as opposed to using CocoaPods).
http://www.mokacoding.com/blog/setting-up-firebase-without-cocoapods/
When I try to build my project, I get the following errors:
"Apple Mach-O Linker Error"
"Linker command failed with exit code 1 (use -v to see invocation)"
I'm familiar with the Linux CLI (less so with Macs), but I don't understand how to apply the -v flag to XCode's build process to get more info.
I've been Googling this for the last 3 hours, but every answer I find seems to be directed at users who weren't using an XCode workspace with CocoaPods.
I don't have CocoaPods installed, so I don't think this is my issue. Despite that I have converted my project and properly imported it into an XCode workspace, this still didn't solve my problem.
My app is a Swift project, and I have imported the modulemap, firebase.h, and googleServices.plist files.
I've also made my Header and Library search paths recursive for the entire project folder in an attempt to fix this.
Here's my project navigation. Although at this point I suspect it's some kind of build setting that isn't correct.
Some selected answers I've tried to apply without success:
Apple Mach -O Linker command failed
In Xcode how do I create a new workspace and add 1 project to it so that I can see the project and its files?
Framework not found GoogleToolboxForMac
Adding system header search path to Xcode
https://github.com/firebase/firebase-ios-sdk/issues/258
Apple Mach-O Linker & Ditto Error - Xcode 8
https://github.com/invertase/react-native-firebase/issues/198
https://forum.ionicframework.com/t/ios-xcode-8-apple-mach-o-linker-ld-error-group-in-xcode/89903
Upgrading to xcode 9.2 fixes this. It appears to be an issue with earlier versions not properly handling linking.
Which is misleading b/c the firebase documentation indicates it's compatible with xcode 8. But I think that's assuming you use cocoapods. If you don't, and instead try to link the obj-c frameworks you need xcode 9+
Once I knew how to examine the more verbose linking error, googling for x86_64 led me to some helpful answers.
This and other answers helped me investigate upgrading.
ld: framework not found Stripe for architecture x86_64

Library not found | linker command failed

I try to build and run my Xcode project but I continue to see it fail due to this issue below.
I tried to clean and build - didn't work
set bitcoede to no - didn't work
reinstall cocoa pods/updatecocoapods - didn't work
Troubleshooting cocoa pods with their link (https://guides.cocoapods.org/using/troubleshooting.html) - didn't work
any ideas? I am using the Firebase cocoa pods and I am in the process of creating a user login page.
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I had something similar. My project is setup a bit differently.
1) First I change my .xcodeproj to a workspace. From "Files->Save As Workspace.." menu option.
2)Ensured that in my project folder that "pod install" had worked and had all the frameworks under the pods folder.
3)Drag the pod.xcodeproj from the project folder into xcode to the top of the project list.
Compiling now succeeded for me.
Hope this helps if you are still having this issue.

Getting Error on compiling project with Parse

I have followed all the steps specified https://www.parse.com/apps/quickstart#parse_push/ios/native/existing and also tried to add Parse Framework from cocoPods but still getting these following duplicate symbol errors, the IOS min version is 7.0 and objective c is used.
The errors are:
duplicate symbol _BFTaskMultipleExceptionsException in:
/Users/sabaanwar/Library/Developer/Xcode/DerivedData/Project1-bybalqattilbrydhswfphyvovcre/Build/Intermediates/Project1.build/Debug-iphoneos/Project1.build/Objects-normal/arm64/FLAnimatedImageView.o
/Users/sabaanwar/Library/Developer/Xcode/DerivedData/Project1-bybalqattilbrydhswfphyvovcre/Build/Intermediates/Project1.build/Debug-iphoneos/Project1.build/Objects-normal/arm64/BaseNetworkModel.o
duplicate symbol _BFTaskMultipleExceptionsException in:
/Users/sabaanwar/Library/Developer/Xcode/DerivedData/Project1-bybalqattilbrydhswfphyvovcre/Build/Intermediates/Project1.build/Debug-iphoneos/Project1.build/Objects-normal/arm64/FLAnimatedImageView.o
.
.
.
ld: 161 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It appears that you are trying to compile the same code twice. This is throwing you an error and may have been caused by you installing the library and also the cocoaPods file. Another possible reason would be that you have same class implementation into two different files. However, I wouldn't expect that with a third party library.
In order to fix that, the easiest way would probably to just delete the project ans start with a clean one. If that isn't possible, delete the cocoaPod, delete the framework and any files that you installed, clean the cache and build the project. It should compile without any problem. Then just install the SDK once.
Hope that helps, Julian
Found the solution over here: https://stackoverflow.com/a/29724276/4841900
The reason was Bolts and FacebookSDK were conflicting each other so i was getting duplicate symbol errors.

Static library and cocoapods with Xcode 6.1.1 - ld: library not found Error

Not sure it is related to Xcode 6.1.1 or Cocoapods 0.35.0.
I have generated new static iOS library with Xcode 6.1.1.
SUCCESS (without cocoapods)
Generate simulator and Device library
Lipo to both and generate FAT MyLib.a static final lib
Create new View Application project. (I haven't changed any default setting. e.g. Base SDK, Valid Architecture.)
Add MyLib.a and necessary header files to application project manually.
Build the app project and IT WORKS FINE !! NO ERROR NO WARNING.
ERROR
Upload same MyLib.a & headers (generated above) to HTTP direct download server(kind of artifact server).
Generate specs & podfile.
Remove all dependency (lib and header) from app project which i have done manually earlier.
Add pod file and local specs
"Pod install" command pull out MyLib.a and header properly in /Pods folder.
But while building the app project gives me
Ld Build/Products/Debug-iphonesimulator/LibTest.app/LibTest normal x86_64
cd /Users/admin/Cocoapods/Project/Library/TestProject/LibTest
export IPHONEOS_DEPLOYMENT_TARGET=8.1
ld: library not found for -lMyLib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When i fire "lipo" command on MyLib.a
Architectures in the fat file: /Users/admin/Cocoapods/Project/Library/Libs/Final/MyLib.a are: armv7 armv7s i386 x86_64 arm64
Its not really architecture issue otherwise it should get failed in my first attempt which doesn't have cocoapods. Cocoapods does some build configuration changes and that creates this issue.
Help me to resolve this issue.
After spending 2 days to figure out the exact issue, i found very silly fix. Its basically issue with static library naming convention issue.
If you have static library in artifact/media http server and wanted to integrate with Cococapods, make sure library name should be lib(your name).a along with headers.
In my case i have kept MyLib and it got dowloaded currently while "pod install" but during app building it was failing.
After renaming to libMyLib.a, every thing works for me. :)
Very easy to apply yet difficult to find such solution]
Not sure whether cocoapods has documented this in there any guide or not.

Error Building Xcode Project after installing AFNetworking via CocoaPods

I am facing the following error when I am attempting to build my Xcode Project after installing AFTNetworking 2.4.1 for iOS 7.1 via CocoaPods..
duplicate symbol _main in:
/Users/nnayudu/Library/Developer/Xcode/DerivedData/Fuse-hksjwkrntgavgvflwlisdncfjobw/Build/Intermediates/Fuse.build/Debug-iphoneos/Fuse.build/Objects-normal/arm64/main-2A00476E021EE59C.o
/Users/nnayudu/Library/Developer/Xcode/DerivedData/Fuse-hksjwkrntgavgvflwlisdncfjobw/Build/Intermediates/Fuse.build/Debug-iphoneos/Fuse.build/Objects-normal/arm64/main-31DB0C4487DDF7B.o
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Additionally in the file browser of Xcode, libPods.a and libPods-AFNetworking.a are red.
I have tried removing arm64 from architectures, building and cleaning CocoaPods multiple times and can not seem to get rid of this error. I also tried adding $(PODS_ROOT) to framework search paths without avail.
Is there a possible solution that exists for this problem?
Please help me out.
There was no problem with the installation of AFNetworking and the error was due to a duplicate .xcodeproj file from past code hidden away in the project.

Resources