iOSBlog icon indicating copy to clipboard operation
iOSBlog copied to clipboard

记一次 CocoaPods 配置错误:新创建Lib,用户手动集成可以,但 CocoaPods 不行

Open ChenYilong opened this issue 7 years ago • 0 comments

我创建了一个Lib,同时支持手动集成和CocoaPods,但是集成者发现手动集成可以,但是 CocoaPods 不行。最后找到了原因。

对比
目录结构 enter image description here enter image description here
spec写法 将 bundle 文件写在了 s.vendored_frameworks 将 bundle 文件写在 s.resources 下
分析 旧的目录结构是这种,会报错误:Apple Mach-O Linker Error Group: Linker command failed with exit code 1 (use -v to see invocation)enter image description here 新的结构不会报错
错误原因 错误地将bundle文件作为了framework文件,你可以打开[cp]Copy Pods Resources 里面的对应的sh文件,发现是空的enter image description here 而这样的结构,对应sh文件非空,负责把bundle文件作为资源倒入到项目中。

all-reward

ChenYilong avatar May 23 '17 04:05 ChenYilong