老项目修改第三方库改Cocoapods

2019-11-07  本文已影响0人  聆听随风

    今天接手了一个老项目,项目第三方库都是导入管理的,决定把第三方库管理统一改成Cocoapods第三方工具管理,出了一堆问题,出现,从网上搜索了很多方法,解决掉一个问题,有时又出一堆其余问题。最终反复好几遍解决,解决方式记录如下。

1. 添加Podfile文件,运行pod install,安装完后

出现的第一个错误:

解决方式:删除Target ->General->Linked Frameworks and Libraries中的

2. pod install 中提示: - Use the `$(inherited)` flag, or

                                    - Remove the build settings from the target.

网上解决方案:This definitely works most of the time:

Go to your target Build Settings -> Other linker flags -> double click . Add $(inherited) to a new line.

If you have problem with "...target overrides the GCC_PREPROCESSOR_DEFINITIONS build setting defined in..." then you must add $(inherited) to your target Build Settings -> Preprocessor Macros

最终只在target Build Settings -> Preprocessor Macros这里面添加$(inherited)

3. 添加完后提示CADebugPrintf.h file not found

这个网上说很多说法一样:给个地址https://blog.csdn.net/silaya0727/article/details/22326307,按这个方式解决我本地出现了很多错误。

CADebugPrintf.h 是地方库的文件,我查看工程确实没有,于是从网上下载该文件,放入文件响应报错位置

下载地址:https://developer.apple.com/library/archive/samplecode/ConvertFile/Listings/PublicUtility_CADebugPrintf_h.html#//apple_ref/doc/uid/DTS40008649-PublicUtility_CADebugPrintf_h-DontLinkElementID_5

该错误解决。

疑惑:程序原先没有该文件,运行不报这个错误,添加Cocoapods,但是还没改动该库呢,也没用Cocoapods管理该库,报这个错误,挺奇怪。

4. 第三步解决完后,C++11 requires a space between literal and identifier 还是报该库有个语法错误,缺少空格,加上就好了。

备注:我改好程序后想重新拿原来错误程序复现下问题,第三步错误没复现,尴尬。

上一篇 下一篇

猜你喜欢

热点阅读