Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapods ld: library not found for -lPods-Projectname

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?

like image 571
Eugene Biryukov Avatar asked Jun 06 '14 09:06

Eugene Biryukov


4 Answers

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

like image 173
Eugene Biryukov Avatar answered Oct 17 '22 12:10

Eugene Biryukov


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

Start using Swift Package Manager (SPM). If your 3rd party lib still do not support SPM I encourage you to take action on adding SPM support on your own. Here is instructions.

Or create an issue for the 3rd party lib about adding support for SPM.

like image 38
Ramis Avatar answered Oct 17 '22 12:10

Ramis


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.
like image 23
mcatach Avatar answered Oct 17 '22 11:10

mcatach


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

like image 23
aybars Avatar answered Oct 17 '22 10:10

aybars