I get these errors when I try to build an iOS application.
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Ld /Users/Markus/Library/Developer/Xcode/DerivedData/Totalbox-clpeqwpfvwuhpleeejnzlavncnvj/Build/Products/Debug-iphonesimulator/Totalbox.app/Totalbox normal x86_64
cd /Users/Markus/Development/xcode/totalbox-ios
export IPHONEOS_DEPLOYMENT_TARGET=7.1
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/iPhoneSimulator7.1.sdk -L/Users/Markus/Library/Developer/Xcode/DerivedData/Totalbox-clpeqwpfvwuhpleeejnzlavncnvj/Build/Products/Debug-iphonesimulator -F/Users/Markus/Library/Developer/Xcode/DerivedData/Totalbox-clpeqwpfvwuhpleeejnzlavncnvj/Build/Products/Debug-iphonesimulator -filelist /Users/Markus/Library/Developer/Xcode/DerivedData/Totalbox-clpeqwpfvwuhpleeejnzlavncnvj/Build/Intermediates/Totalbox.build/Debug-iphonesimulator/Totalbox.build/Objects-normal/x86_64/Totalbox.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -framework CoreGraphics -framework Foundation -framework MobileCoreServices -framework QuartzCore -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework CoreGraphics -framework UIKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/Markus/Library/Developer/Xcode/DerivedData/Totalbox-clpeqwpfvwuhpleeejnzlavncnvj/Build/Intermediates/Totalbox.build/Debug-iphonesimulator/Totalbox.build/Objects-normal/x86_64/Totalbox_dependency_info.dat -o /Users/Markus/Library/Developer/Xcode/DerivedData/Totalbox-clpeqwpfvwuhpleeejnzlavncnvj/Build/Products/Debug-iphonesimulator/Totalbox.app/Totalbox
PODS ROOT in the build settings:
${SRCROOT}/Pods
I didn't create this Xcode project - just pulled it from git to check it out.
This question is related to
ios
objective-c
xcode
clang
cocoapods
After hours of research this solution worked for me:
(disclaimer: results may vary due to circumstances)
the Library not found -lPods-(someCocoapod)
error was due to multiple entries in the :
Settings(Target) > Build Settings > Linking > 'Other Linker Flags'
A lot of other posts had me look there and I would see changes to the error when I messed around with the entries, but I kept getting some variation on the same error.
Too many hours lost ...
remove the -lPods-(someCocoaPod) lines in the 'Other Linker Flags' list BUT only if $(inherited) is at the top. At first I was unsure, but the reassuring sign was that I still saw references to my cocoapods when I left the edit mode(inherited). I tested in debug and release, both of which were giving me errors, and the problem was immediately resolved.
I had the same problem
pod install and pod update on command line resolve my problem
This problem-related to lPods can be fixed by following the steps below
"Build Phases"
in "Link Binary With Libraries"
.".a"
file of that library which is creating the problem. This will work.
None of the above answers fixed it for me.
What I had done instead was run pod install
with a pod
command outside of the target
section. So for example:
#WRONG
pod 'SOMEPOD'
target "My Target" do
pod 'OTHERPODS'
end
I quickly fixed it and returned the errant pod back into the target
section where it belonged and ran pod install
again:
# CORRECT
target "My Target" do
pod 'SOMEPOD'
pod 'OTHERPODS'
end
But what happened in the meantime was that the lib -libPods.a
got added to my linked libraries, which doesn't exist anymore and shouldn't since there is already the -libPods-My Target.a
in there.
So the solution was to go into my Target's General settings and go to Linked Frameworks and Libraries and just delete -libPods.a
from the list.
My way
create new project and install pod it will can run without error.
Copy text in "Other Linker Flags" in new project to old project. Make old project to same new project.
Check "Header Search Paths" too.
For me, following had worked.
Clean and run the project. If still error receives the same then try by setting "Project Target -> Build Settings -> Build Active Architectures Only", Set "Debug" to "YES" and set "Integration and Release" to "No". Then Repeat the same setting of "Build Active Architectures Only" for all "Pods Targets"
Clean and run the project. If you receive the following error
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
Then try Mr. Mike answer in this link
Hope it helps!
In a project with multiple targets I had the same issue after changing the Scheme and App name and tried to update pods. The issue was caused because of multiple entries in Build Phases -> Link Binary with Libraries where both the previous .a library and the current one was listed, while the previous one was not existing anymore. Removing the library from there cleared the problem.
For me this is worked. I have changed my app name from someApp to otherApp. And I am using cocoa pods for multiple third party services integration. So Because of that 2 libPod files added(As I have changed name and target of app). Finally I had to remove one libPod. And it worked.
target-> Build phases-> Link Binary With Libraries
If anyone came here to resolve an error with react-native-fbsdk
after installing it using Cocoapods
, keep in mind that you have to remove all the other .a files in your Projects build phases and only keep the .a from cocoapods called libPods-WhateverAppName.a
.
This is usually caused from running rnpm link
and the way rnpm works.
After I removed the facebook core .a file from my build phases my project was up and running once again.
If you have multiple targets in your project, Cocoapods may have only integrated itself well with just one of them.
I had to manually link to libPods.a
in "Link Binary With Libraries" for each additional target I had.
It seems project has been using cocoapods. and that files are missing from your project.
You cant just download it from git. You need to install it from cocoapods.
for more help, you may follow Introduction to CocoaPods Tutorial
If the project uses CocoaPods
be aware to always open the .xcworkspace
file instead of the .xcodeproj
file
The below solution worked for me for the core-plot 2.3 version. Do the below changes under other linker flags section.
1.Add $(inherited) and drag this item to top position 2.Remove "Pods-" prefix from -l"Pods-fmemopen”, l"Pods-NSAttributedStringMarkdownParser” and -l"Pods-MagicalRecord”.
if still issue persists, Finally see if PODS_ROOT is set or not. You can check it under user defined section.
If the project uses CocoaPods be aware to always open the .xcworkspace file instead of the .xcodeproj file. if you are using .xcworkspace , Please reinstall the pod file by removing the pods and again insert the pods and install it !!! this worked for me
This was my issue while trying to integrate Firebase to my Xcode project using cocoapods
library not found for -lGoogleToolboxForMac
linker command failed with exit code 1 (use -v to see invocation)
After hours of searching and trying out various fixes listed in the stackoverflow, my issue was finally fixed doing following steps
Do this for all targets.
ios/Pods
)pod update
Voila! All linker errors will be gone.
My problem had fixed by the following config:
Build Active Architecture Only: YES
I got the same error.
The issue: I created a separate Workspace and added my existing project into it. I got the error when I worked on that Workspace.
The fix: Later I found that Workspace gets created automatically inside the existing project when dependencies are added. And have to work on that workspace.
Had this problem as well. Something was wrong with my CocoaPods installation. No pods other than KIF were installing properly. I followed the comments on this thread to be of help.
Basically, I needed to ensure that Build Active Architectures Only
settings for both my project and the Pods project were equal.
Delete all the corresponding files/folders of imported cocoapods source except podfile.
install cocoapod
again.This should clear any redundant pull from the original source.
When you clone project from somewhere which uses Cocoapods you need to install them to your project.
Here step-by-step what you need to do:
Good luck!
Had a same issue after upgrading Deployment target
from 7.0
to 8.0
and enabling use_frameworks!
cocoapods
did not delete previously generated PodName.a
files from the Frameworks
section of my project.
So I had to delete those manually, because they caused the linker error
My steps:
In addition to making sure "Build Active Architectures" was set to YES as mentioned in previous answers, this was what had done it for me.
Source: Stackoverflow.com