xcode - linker command failed with exit code 1 - build settings - ios

I'm using Xcode 7 and can't build successfully because of the following error:
ld: framework not found Pods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The error above is associated with the following file:
Ld /Users/(USERNAME)/Library/Developer/Xcode/DerivedData/(PRODUCT NAME)-(RANDOM STRING)/Build/Intermediates/(PRODUCT NAME).build/USDev-iphonesimulator/(COMPANY NAME).build/Objects-normal/i386/(COMPANY NAME) normal i386
cd /Users/(USERNAME)/Developer/(PRODUCT NAME)-ios
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
This error started occurring after merging multiple branches of code (each branch worked properly prior to the merge). Can somebody tell me what is causing this error and how I can get past this problem?
----- UPDATE -----
Spending more time on this problem, I've noticed that the merged code works on my coworkers computers so the issue must be local. Looking at the "Build Settings" (Go to the workspace file -> Build Settings (middle pane)), I noticed that the settings under the "Linking" section of "Build Settings is different between Xcode on my machine compared to my coworkers. Not sure if this is the root issue, but does anybody know what I need to do in order to set the Linking settings?

There was an extra framework that I needed to remove:
Go to your .xcworkspace file
Click on the "General" tab in the Editor pane
Scroll down to the "Linked Framework and Libraries" section
Find the framework/library that the compiler is complaining about (in my case it was called "framework.Pods"
This problem stumped me for days...

Related

Xcode 7 simulator error "duplicate symbols for architecture x86_64"

My development environment with Xcode 7.2.1, CocoaPods 1.0.0 and GoogleMaps 1.13.2
I can build code successful to generate a XXX.ipa file and install in my iPhone 6 Plus to work correctly.
But when I run Xcode simulator by item "iPhone 6" or "iPhone 6 Plus" always get the information as below
"xxxx duplicate symbols for architecture x86_64" "linker command
failed with exit code 1 (use -v to see invocation)"
I use the following solutions still can't fix it
Build Options -> Enable Bitcode -> set "No"
Remove -ObjC from Other Linker Flags
project Targer -> Build phases -> compile sources, ckeck no duplicate files
Make sure I haven't #imported a .m file
I am wondering if there are any other method to solve this, help would be appreciated thanks.
This error generally occurs when you have linked any library or file twice.
In the error desciption, the name of the duplicated file will be listed, you can search and and make sure you don't have duplicates.
If you find duplicates, remove reference to one of them to play safe
I have faced similar kind of issue.
In my application I have run my code and created ipa before two day. And today when I am trying to run same code without any changes I am getting:
ld: 102 duplicate symbols for architecture x86_64 clang: error: linker
command failed with exit code 1 (use -v to see invocation)
The solution for this duplication Linker error can be solved by Remove all of your classes from compile sources, then click the + button and search for the term '.m'. Highlight every class, then click add. Build and run again.
This problem can also be occurred in case you import ".m" file instead of ".h" by mistake. I know it may be seemed as a stupid advise but this is what I had done in my case.
I resolved this issue by removing the -all_load flag in the Build Settings-> Other Linker flags.

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.

Debug scheme won't build - Apple Mach-O Linker Error. Linker command failed with exit code 1

ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I get this error way too often and it's driving me (and the team nuts). The project was building just fine last week and I did nothing to the project in the mean time, just opened it yesterday and now I'm getting this error when building using the Debug scheme only; Adhoc builds fine. I'm running the latest Yosemite, Xcode 6.1 (but this has plagued me for many months anyway). My instructions to resolve it work occasionally, like black magic:
Clean
Restart Xcode
Delete derived data (check preferences/locations)
Pod update
Open project using the Workspace file
Delete the workspace file and run pod install
But unfortunately this time it's just not working! I've done this process over and over. I'm so frustrated with this PoS Xcode. Next step would be to re-download the project from Git, but there must be a better way! I have gone through a number of other stack overflow posts but found nothing to help (nor anything very recent). Thanks!
The same error drove me nuts for two days. I fixed through the following :
Project > Targets > Build Settings > Packaging > Product Name - Check if the product name has changed.
Also try setting the Build Active Architecture to NO in your project..
Project/Pods > Build Settings > Architectures > Build Active Architecture Only
Just delete the build folder of your project and rebuild it again. Always works for me!

linker command failed in Xcode

I was building an app, but later on I quickly changed something(a value in char variable) and tried to load again, now I am getting this error
ld: 9 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have undone what I have done, but still I am getting this error.
I have tried to delete build folder, it did not work... I also performed clean and build but still it cannot build...
You have to check the files included in the build. Quite possibly there are some duplicate implementation (or perhaps header?) files included.
Navigate to {Project} > {Target} > Build Phases.
Check the Compile Sources build phase for duplicates.
Remove all duplicate files.
Also make sure no duplicate libraries are included in the project. You may check this in the Link Binary With Library phase. Basically same story as above, but for libraries.
Finally make sure to clean the project before building (Product > Clean).
My error message was a little different - duplicate symbols ... in ClassImplmentationFile.m
I didn't have any of the duplicates, as described above, but I noticed that the .m files that were listed in the error message, were in Build Phases/ Compile Sources.
I removed them from there and the thing ran fine.
I didn't put them in there. I guess Xcode auto-screwed-up my project at some point. : - )

clang: error: linker command failed with exit code 1, only when testing on device

I was just about to test my app on a device when I ran into this problem, I'm getting this Linker Error.
I've already checked all my compile sources and Build Phases, but there's no sign of my importing things twice.
ld: duplicate symbol _calculateNextSearchPage in /Users/wouter/Sites/test/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit) and /Users/wouter/Sites/test/FastPdfKit.embeddedframework/FastPdfKit.framework/FastPdfKit(FastPdfKit) for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This only happens when testing on a device, not in the simulator.
Alright guys I had the same problem. Seems like I fixed it.
I am using cocapods therefor the described standard procedure can not be properly executed.
Steps to do to properly add FastPDFKit with Cocoapods.
Download FastPDFKit
In your project Add Files to "Your Project"
go to FastPDFKit folder you just have downloaded
locate 1 folder and 1 project file. Press and hold Command key and add these in to your project
FastPdfKit.xcodeproj
FastPdfKit.embeddedframework
(Note: FastPdfKit.embeddedframework is the actual Framework and you
might want to open FastPdfKit.xcodeproj standalone before adding it
to your project, delete FastPdfKit.embeddedframework folder from
your disk and Build FastPdfKit target in the project. You should see
newly created FastPdfKit.embeddedframework folder)
Go to your Project Settings > Your target > Build Phases > Link Binary with Libraries
Make sure FastPdfKit.framework is there.
If not, drag it from the project and put it there.
Clean the project, delete derived data
Add #import <FastPdfKit/FastPdfKit.h> where you need it and you are good to go.
Here is how my Link Binary with Libraries look like
Please let me know if you have any troubles I might've missed something.
Try to delete duplicate files/images which are in target-> Build phase -> Compile files, Copy bundle resources

Resources