use_frameworks!
- Podfile中添加 use_frameworks! ,pod install 后生成libPods-XXX.a静态库。
- Podfile中不添加 use_frameworks! ,pod install 后生成Pods_XXX.framework动态库
OC项目中Pod默认是不添加 use_frameworks!的,Swift项目中Pod默认是添加 use_frameworks!的,而项目中使用Swift库只能是framework动态库,所以在OC项目中使用Swift pod库需要在Podfile中添加use_frameworks! ,否则pod install会报错。
如果再添加 后,pod install出现如下错误:
The ‘Pods-XXX‘ target has transitive dependencies that include statically linked binaries:
(/Users/XXXX/XXXX/XXXX/XXXX.framework)
解决办法,在Podfile中添加如下代码:
pre_install do |installer|
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
en