use_frameworks!
- Podfile中添加 use_frameworks! 哮塞,pod install 后生成libPods-XXX.a靜態(tài)庫外恕。
- Podfile中不添加 use_frameworks! 这揣,pod install 后生成Pods_XXX.framework動態(tài)庫
OC項目中Pod默認(rèn)是不添加 use_frameworks!的瘩缆,Swift項目中Pod默認(rèn)是添加 use_frameworks!的,而項目中使用Swift庫只能是framework動態(tài)庫吃谣,所以在OC項目中使用Swift pod庫需要在Podfile中添加use_frameworks! 撕予,否則pod install會報錯。
如果再添加 后蜈首,pod install出現(xiàn)如下錯誤:
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