在老项目工程中使用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编译,项目即可正常运行。

library not found for -lPods 的解决办法的更多相关文章

  1. Anaconda"无法定位程序输入点 OPENSSL_sk_new_reserve 于动态链接库Anaconda3\Library\bin\libssl-1_1-x64.dll上"的解决办法

    Anaconda"无法定位程序输入点 OPENSSL_sk_new_reserve 于动态链接库Anaconda3\Library\bin\libssl-1_1-x64.dll上" ...

  2. Maven项目Update Project后JRE System Library自动变回1.5解决办法

    最近在搭建Spring Boot项目<一步步搭建 Spring Boot maven 框架的工程>的时候,虽然设置JRE System Library为1.8,但是,当我 用 Maven ...

  3. 对于“Newtonsoft.Json”已拥有为“NETStander.Library”定义的依赖项,解决办法

    问题描述: 在使用visual studio中的NuGet包管理下载程序时,有时会出现-对于“Newtonsoft.Json”已拥有为“NETStander.Library”定义的依赖项,这样的错误. ...

  4. Cannot find executable for CFBundle 解决办法

    出错日志为:2013-12-29 01:17:49.785 Displaying Alerts with UIAlertView[419:70b] Cannot find executable for ...

  5. vs2010用NuGet(程序包管理)安装EF失败之解决办法

    今天用程序包管理控制台安装EF.报错.如下

  6. iOS开发遇到的坑之六--使用cocopods管理第三方库时,编译出现Library not found for -lPods问题的解决办法

    在项目中有时候会遇到Library not found for -lPods(这里的IPods指的是你具体的第三方库)的问题 出现这个错误的原因是:xcode在编译的时候找不到这个库,从而导致项目无法 ...

  7. xocodebulid 自动化打包 解决提示 ld: library not found for -lPods 问题

    如果你的项目用到cocopod 第三方库.使用xcodebulid 估计会出现 ld: library not found for -lPods 以下 是我的解决办法 xcodebuild -work ...

  8. 解决 ld: library not found for -lPods的问题

    现在打开有pods建好的workspace文件,尝试编译,会报ld: library not found for -lPods错误,原因就是工程里面的设置项覆盖了pods中xcconfig中的设置.解 ...

  9. Eclipse 关于“The type * is not accessible due to restriction on required library”问题的解决办法

    The type * is not accessible due to restriction on required library”的错误, 意思是所需要的类库由于受限制无法访问. 解决办法: 1 ...

随机推荐

  1. Spring的lookup-method标签

    Spring的解析源码 public void parseLookupOverrideSubElements(Element beanEle, MethodOverrides overrides) { ...

  2. POJ 2342 (树形DP)

    题目链接: http://poj.org/problem?id=2342 题目大意:直属上司和下属出席聚会.下属的上司出现了,下属就不能参加,反之下属参加.注意上司只是指直属的上司.每个人出席的人都有 ...

  3. 如何对Backbone.Collection进行过滤操作

    首先我想说的是这篇文章的题目起的很怪,因为我不知道起个什么名字比较好.渲染列表是我们应用中最常见的操作了吧,在运用Backbone的应用中,我们一般会把列表作为一个Collcetion,然后指定一个V ...

  4. 用iftop监控流量

    1.下载iftop http://pan.baidu.com/share/link?shareid=387372457&uk=1829018343 或 wget http://www.ex-p ...

  5. HttpClient_HttpClient 4.3.6 HTTP状态管理

    HTTP状态管理 最初的HTTP被设计成以状态.请求/应答为导向的协议,它被制作成是没有特殊条款的,以便在状态会话中能交换逻辑关系请求/应答.HTTP协议越来越受欢迎和被采用,越来越多的系统会在应用程 ...

  6. 什么是SQL注入式攻击

    什么是SQL注入式攻击? 所谓SQL注入式攻击,就是攻击者把SQL命令插入到Web表单的输入域或页面请求的查询字符串,欺骗服务器执行恶意的SQL命令.在某些表单中,用户输入的内容直接用来构造(或者影响 ...

  7. 去掉Xcode源码末尾的空格

    去掉Xcode源码末尾的空格 在用 Xcode 开发的时候,很容易就在行末增加一些空格了.这些空格在上传到 review board 上后 , 就会被特别的颜色显示出来.因为一种好的编程风格是说 , ...

  8. 转载--thinkphp框架的路径问题 - 总结

    转自:http://blog.sina.com.cn/s/blog_827ddd950100ulyv.html TP中有不少路径的便捷使用方法,比如模板中使用的__URL__,__ACTION__等, ...

  9. Shtml妙用

    shtml用的是SSI指令, SSI指令虽然不多 但是功能相对而言还是很强大的, 在PHP禁止了命令执行函数和开了安全模式的时候可以试试看 也可以在服务器允许上传shtml后缀脚本的时候试试 PS:只 ...

  10. Leetcode | N-Queens I & II

    N-Queens I The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no ...