在老项目工程中使用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. 在CentOS下利用Eclipse调试FFmpeg

    所需软件 64位软件打包下载链接:http://pan.baidu.com/s/1i3B08Up 密码:o50u https://yunpan.cn/cBKDSbrGDgBvz  访问密码 1f55 ...

  2. LightOJ1157 LCS Revisited(DP)

    题目求两个字符串s1,s2不同的LCS个数. 经典的求LCS的DP是这样的: LCS[i][j]表示s1[0...i]和s2[0...j]的LCS LCS[i][j]从LCS[i-1][j-1]+1( ...

  3. BZOJ3834 : [Poi2014]Solar Panels

    问题相当于找到一个最大的k满足在$[x_1,x_2]$,$[y_1,y_2]$中都有k的倍数 等价于$\frac{x_2}{k}>\frac{x_1-1}{k}$且$\frac{y_2}{k}& ...

  4. Android 第三方

    把优酷.土豆等取出它们真是的视频播放地址:http://vparser.com/ volley 项目地址 https://github.com/smanikandan14/Volley-demo (1 ...

  5. intro.js 页面引导简单用法

    下载地址:http://pan.baidu.com/share/link?shareid=1894002026&uk=1829018343 <!DOCTYPE HTML PUBLIC & ...

  6. String, StringBuffer, StringBuilder(转载)

    http://blog.csdn.net/rmn190/article/details/1492013 String 字符串常量StringBuffer 字符串变量(线程安全)StringBuilde ...

  7. COJ976 WZJ的数据结构(负二十四)

    试题描述 输入一个字符串S,回答Q次问题,给你l,r,输出从Sl--Sr组成的串在S中出现了多少次. 输入 第一行为一个字符串S.第二行为一个正整数Q.接下来Q行每行为l,r. 输出 对于每个询问,输 ...

  8. new在c#方法中的使用

    new在c#中有三种用法: 1.实例化对象 2.泛型约束 3.用在方法前.new和override的区别在于:override用于重写父类的方法:new用于隐藏方法,它调用的方法来自于申明的类,如果申 ...

  9. people 0919

    package liu0919; public class People { private double height;// 身高 private String name;// 名字 private ...

  10. hdu Random Sequence

    这道题是道规律极强的题...真佩服在赛场上快速找到规律的人. d[i]              a[i]            res[i] 0                 1.000000 C ...