CocoaPods版本升级
最近在研究项目组件化,用到子项目打包成动态库时要依赖第三方静态库,而主项目也依赖第三方库,比如CTMediator,Masonry等
运行时会报错
objc[58067]: Class CTMediator is implemented in both /Users/pc/Library/Developer/Xcode/DerivedData/EducationPlatform-bhcheptxbpeumlcidxlgenbqgbsk/Build/Products/Debug-iphonesimulator/WPHomeModule.framework/WPHomeModule (0x107f485b0) and /Users/pc/Library/Developer/CoreSimulator/Devices/08988D83-C258-4760-A2E0-50D921C46923/data/Containers/Bundle/Application/897E4AB0-FC0C-435B-893A-313EB1CA5343/EducationPlatform.app/EducationPlatform (0x1019f40e8). One of the two will be used. Which one is undefined.
objc[58067]: Class MASCompositeConstraint is implemented in both /Users/pc/Library/Developer/Xcode/DerivedData/EducationPlatform-bhcheptxbpeumlcidxlgenbqgbsk/Build/Products/Debug-iphonesimulator/WPHomeModule.framework/WPHomeModule (0x107f48600) and /Users/pc/Library/Developer/CoreSimulator/Devices/08988D83-C258-4760-A2E0-50D921C46923/data/Containers/Bundle/Application/897E4AB0-FC0C-435B-893A-313EB1CA5343/EducationPlatform.app/EducationPlatform (0x1019f5588). One of the two will be used. Which one is undefined.
原因是两边同时引用了这两个库,但因为POD设置生成的是静态库,所以两边编译的时候都把库链接进去了,而APP的命名空间又一样。造成冲突,需要将这些库封装为动态库,但发现cocoapods版本低了,需要升级。所以找到下面的链接。
https://blog.csdn.net/yaoliangjun306/article/details/77824136