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.
Related
I'm using Firebase via RNFirebase in React Native. I've gone through the steps here: https://rnfirebase.io/docs/v5.x.x/installation/ios.
Debug builds in the Simulator and to my device work just fine, but when I attempt to archive a Release build it fails with this error.
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/FirebaseAuth'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/FirebaseCore'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/GTMSessionFetcher'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/GoogleUtilities'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/nanopb'
ld: library not found for -lFirebaseAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Also in the build logs I can see that the Debug config builds those targets, but they are not in the output for Release config builds. I get the feeling it has to do with building for all architectures, but don't know how where to start solving that. I just feel like I am poking around without a real strategy to solve it. Any ideas?
Some things I have tried...
Using the Legacy Build System
Removing node_modules and rerunning npm install
Removing / adding the related pods
Deintegerating and readding Cocoapods
Clearing DerivedData
Restarting my computer
I've seen this happen when switching use_frameworks! off and on.
The solution was deleting FirebaseAuth and other libraries from the Build Setting - Other Linker Flags(OTHER_LDFLAGS)
I got help from this PR: https://github.com/invertase/react-native-firebase-starter/pull/61
It was a combo of dropping down to the Legacy Build System in Xcode 10 and upgrading React Native to 0.57.2.
I'm currently not using pods at all for my project, instead i'm using carthage but unfortunately they don't have carthage support so I followed this tutorial here http://www.danishin.com/article/Google_Analytics_For_iOS_Without_Cocoapods but after I tried building the project i got ld: library not found for -lGoogleAnalyticsServices from Apple Mach-O Linker (ld) Error .. Linker command failed with exit code 1 (use -v to see invocation) I've already looked around other questions/answers on here but didn't have any luck at all.
I've tried these things below
Disabled bitcode
Made sure library search paths had the correct path to libGoogleAnalyticsServices
Deleted DerivedData, Cleaned, Closed XCode, Rebuild
I have just installed the Facebook using pods and now my project is not working and says. Please help someone.
Apple Mach-O Linker Error
ld: 87 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
duplicate symbols for architecture means your files are doubled, Please check if you have added facebook framework manually before using pods
you can also check files duplicating by seeing whole description of error
Solution 1
You need to do this:
Click on your project (targets) Click on Build Settings Under Library Search Paths, delete the paths May be this will help you.
Solution 2
You have duplicate symbol method which means there are duplicate file in project
In your Target's Build Phase, under "Compile Sources" check if there are duplicate file and delete one if you have duplication.
Hope this will help you.
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.
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.