ChenYilong / ChenYilong/iOSBlog
记一次 CocoaPods 配置错误:新创建Lib,用户手动集成可以,但 CocoaPods 不行
- Dominant language
- Objective-C
- Stars
- 1.1k
- Forks
- 184
- PR merge metrics
- No merged PRs in 30d
Description
我创建了一个Lib,同时支持手动集成和CocoaPods,但是集成者发现手动集成可以,但是 CocoaPods 不行。最后找到了原因。
对比 | 旧 | 新
-------------|-------------|-------------
目录结构 | | 
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) | 新的结构不会报错
错误原因 | 错误地将bundle文件作为了framework文件,你可以打开[cp]Copy Pods Resources 里面的对应的sh文件,发现是空的 |而这样的结构,对应sh文件非空,负责把bundle文件作为资源倒入到项目中。

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.