library not found for -lPods 的解决办法

作者:佚名 上传时间:2019-04-08 版权申诉

在老项目工程中使用cocoapods,可能会报这个错误:library not found for -lPods .

导致这个错误可能有两个原因,这两个原因在编译过程中都是有蛛丝马迹可循的。

原因1:

在 pod install时,就会有告警信息提示:

xxx target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation

xxx target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation

xxx target overrides the `OTHER_CFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation

This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

很明确的告知:通过添加 `$(inherited)` flag 可以解决该问题。

根据调试确认,OTHER_LDFLAGS 指的是 other linker flags; OTHER_CFLAGS 指的是 other c flags;HEADER_SEARCH_PATHS 指的是 header search paths.

将这三处修改完毕后再次运行pod install,可以发现告警信息已经不再出现了。


原因2:

在编译时有如下的警告和错误:

1.警告: Target 'Pods' of project 'Pods' was rejected as an implicit dependency for 'libPods.a' because its architectures 'arm64' didn't contain all required architectures 'armv7 arm64'

2.错误: ld: library not found for -lpop
clang: error: linker command failed with exit code 1 (use -v to see invocation)

这里不留神可能警告会被忽略(毕竟在一个老项目中有一些警告很正常),但这个警告才是问题的关键。

pod里面的build选项里build active architecture only 在 debug情形下默认是 YES, 这里如果和你项目的该设置不匹配(笔者用来调试的项目这里设置就是NO)的话那么就会报告该错误。

在pods里面的target中挨个修改其配置和原有的工程一致,然后clean编译,项目即可正常运行。

免责申明:文章和图片全部来源于公开网络,如有侵权,请通知删除 server@dude6.com

用户评论
相关推荐
library not found for -lPods 解决办法
在老项目工程中使用cocoapods,可能会报这个错误:library not found for -lPods . 导致这个错误可能有两个原因,这两个原因在编译过程中都是有蛛丝
CocoaPods:library not found for -lPods
This is my first shot to write a blog in English. Enjoy! ;) CocoaPods is a popular
was not found on the java.library.path
apache的apr 博文链接:https://gaojianqi6.iteye.com/blog/1159875
RAR
0B
2019-04-09 21:31
在macOS上使用Xcode编译时出现错误 'ld: library not found for -lPods'
这个错误通常表示Xcode无法找到CocoaPods生成的库。首先,尝试执行以下步骤解决该问题。首先,确保你使用的是.xcworkspace文件而不是.xcodeproj文件来打开你的Xcode项目。
Xcode 12.0及以上
Xcode
2023-12-13 20:12
movie not found解决办法iis
主要介绍了movie not found的解决办法(iis),需要的朋友可以参考下
PDF
30KB
2020-12-31 07:28
error: No curses/termcap library found解决办法
mysql版本:5.1.30 已经不记得这次是第几次安装mysql了,遇到这个问题倒是第一次。 之前在tar,./configure,make,make in
sqlite3not found解决办法
NULL博文链接:https://ramosli.iteye.com/blog/1966202
ZIP
0B
2019-09-23 23:02
Not found the kernel library打不开修复工具.rar
软件介绍: 如果在打开某一程序时出现错误提示:Not found the kernel library or the kernel library is invalid,那是因为缺少相应的内核文件所致
RAR
421KB
2020-08-19 15:34
environments was not found on the java.library.path问题解决方法
The APR based Apache Tomcat Native library which allows optimal performance in production environmen
PDF
107KB
2020-09-29 09:38
MASM0001metrodefault.xml not found解决办法
使用weblogic12c发布jax-ws的webservice服务端,或升级weblogic到weblogic12.1.3,启动时报错“metro-default.xmlnotfund错误的解决办法
zip
0B
2019-09-07 06:51