Cocoapods ld: library not found for -lPods-Projectname

IosObjective CCocoapods

Ios Problem Overview


I've installed cocoa pods library and some frameworks through it. Now when I compile project the build fails.

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

Here part of text:

Ld /Users/polzovatel/Library/Developer/Xcode/DerivedData/Project-bybevfqrgvqqldbzsgewqafpmylj/Build/Products/Debug-iphonesimulator/Project app/Project normal i386
    cd /Users/polzovatel/Projects/iOS-master/Project_iPhone
    export IPHONEOS_DEPLOYMENT_TARGET=6.0
    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"

What I need to do to fix this problem?

Ios Solutions


Solution 1 - Ios

Fixed it by deleting the -lPods-Projectname.a in Link Binary (for newer versions, delete the -lPods-Projectname.a under the Frameworks group).

Solution 2 - Ios

Whenever I execute "pod install" it leads me to spend several hours of fixing something related with it. So, I deleted CocoaPods stuff and do not have problems any more! Now I am lucky and happy man.

Solution 3 - Ios

The exact location that you should remove your libs is at:

  • Remove -lyourlibname.a in "Link Binary With Libraries" on "Build Phases" of your target.

Solution 4 - Ios

You can try "Build Active Architecture Only" = YES . it may be solving problem.

Solution 5 - Ios

Ensure that Build Active Architectures Only settings for both of your project and the Pods project were equal for debug and release configuration! That's was a problem in my case.

Solution 6 - Ios

Make sure Build Active Architectures Only in your Project/Target and in your Pod/Target and Pod are the same. We often set the debug yes and set the release no.

Solution 7 - Ios

I realized the xcproject file was opened instead of the updated workspace. This fixed my error. Hope this information will help others too.

Solution 8 - Ios

If none of the other answers help you, try this:

  • Deintegrate cocoa pods using pod deintegrate. Check this link https://github.com/kylef/cocoapods-deintegrate.
  • Search on the build settings for target and project file for "pod". Anything that looks like it belonged to cocoa pods, remove.
  • Finally, run pod install once again.

Solution 9 - Ios

Go to Product > Scheme > Edit Scheme... > Build > + > Add the Pods-Projectname.a and drag it to the top > Clean & Build your project.

Solution 10 - Ios

I had a very different experience. I tried removed the library from build settings to no avail. And honestly, I couldn't see the logic behind it.

What I did was try a new pod install. And so it gave me this error

> [!] The ProjectName [Debug] target overrides the LIBRARY_SEARCH_PATHS build setting defined in Pods/Target Support Files/Pods-/Pods-.debug.xcconfig. This can lead to problems with the CocoaPods installation - Use the $(inherited) flag, or - Remove the build settings from the target.

>[!] The ProjectName [Release] target overrides the LIBRARY_SEARCH_PATHS build setting defined in Pods/Target Support Files/Pods-/Pods-.debug.xcconfig. This can lead to problems with the CocoaPods installation - Use the $(inherited) flag, or - Remove the build settings from the target.

So I did what it told me to, I added the $(inherited) flag to build settings. And all worked well

Solution 11 - Ios

In my case I found that a mis-match of deployment target of the Project (iOS 11.4) versus the Target (iOS 10.3). Updating the target to iOS 11.4 fixed the issue.

Project > Info > Deployment Target > iOS Deployment Target
Project > Target > General > Deployment Target > Target

Podfile: platform :ios, '11.4'

enter image description here enter image description here

Solution 12 - Ios

I had this problem when I accidentally opened project instead of workspace so Cocoapods where missing....

Solution 13 - Ios

Check your Project -> Targets -> Build Phases -> Link Binary With Libraries

enter image description here

Solution 14 - Ios

Point to your Pods project, set the BaseSDK to iOS SDK since 'pod install' process clear it. Also set Build Valid Architecture Only to NO That should work.

Solution 15 - Ios

I experienced a similar error which affected one of my computers but not the other when compiling the same project.

I reinstalled cocoapods, all gems, rebuilt the project and none of it worked. I finally got it to compile but required me to completely remove Xcode and related data (iPhone simulator, DerivedData) then reinstall Xcode.

Solution 16 - Ios

I've had this error after adding a new build configuration.

pod install helped, because it adds separate settings for each build configuration.

Solution 17 - Ios

i also had the same sort of issue. So Check your pod file's platform :ios . and check Deployment info target versions. and please make sure version of both files are same. if both are not same the issue will be executed. i also had the issue after library updating my react native project

(Target info = select your project, then select target, In general section Deployment info is available.)

enter image description here

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEugene BiryukovView Question on Stackoverflow
Solution 1 - IosEugene BiryukovView Answer on Stackoverflow
Solution 2 - IosRamisView Answer on Stackoverflow
Solution 3 - IosmcatachView Answer on Stackoverflow
Solution 4 - IosaybarsView Answer on Stackoverflow
Solution 5 - IosskywinderView Answer on Stackoverflow
Solution 6 - IosjiexishedeView Answer on Stackoverflow
Solution 7 - IosJIANGView Answer on Stackoverflow
Solution 8 - IosHotFudgeSundayView Answer on Stackoverflow
Solution 9 - IosEladView Answer on Stackoverflow
Solution 10 - IosMNassarView Answer on Stackoverflow
Solution 11 - IosChristopherView Answer on Stackoverflow
Solution 12 - IosRenetikView Answer on Stackoverflow
Solution 13 - IosKaptainView Answer on Stackoverflow
Solution 14 - Ioshungdm9999View Answer on Stackoverflow
Solution 15 - IosHDevejianView Answer on Stackoverflow
Solution 16 - IosdreamzorView Answer on Stackoverflow
Solution 17 - IosRamesh ChathurangaView Answer on Stackoverflow