Cocoapods ld: library not found for -lPods-Projectname

回眸只為那壹抹淺笑 提交于 2019-11-27 11:18:47
Eugene Biryukov

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

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.

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

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.

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.

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.

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

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.

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

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

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

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

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.

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.

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!