首页 > 解决方案 > 有没有办法在 Cocoa Pods 的单个目标中使用静态和动态框架

问题描述

跑步的时候install_dynamic_library,我想用use_frameworks! :linkage => :dynamicall_binary!另一方面,跑步的时候install_static_library,我想用use_frameworks! :linkage => :static

有没有办法解决这个问题?

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

plugin 'cocoapods-binary'
plugin 'cocoapods-pod-linkage'

def install_dynamic_library

  pod 'R.swift'
  pod 'Alamofire'
  pod 'Nuke'
  pod 'Parchment', '~> 3.0'
  pod 'SnapKit', '~> 5.0.0'
  pod 'Kanna', '~> 5.2.2'
  pod 'ImageViewer'
  pod 'PanModal'
  pod 'SideMenu'
  pod 'Toast-Swift', '~> 5.0.1'
  pod 'youtube-ios-player-helper', '~> 1.0.2'
  pod 'SwiftDate'
  pod "URLEmbeddedView"
  pod 'ActiveLabel'
end

def install_static_library

  pod 'GoogleMobileAdsMediationFacebook'
  pod 'Google-Mobile-Ads-SDK'
  pod 'Firebase/Analytics', '~> 8.1.0'
  pod 'Firebase/Messaging'
  pod 'Firebase/Auth'
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.1.0'
  pod 'FirebaseFirestoreSwift', '8.2.0-beta'
  pod 'Firebase/Storage'
end

target :'MyApp' do
  install_dynamic_library
  install_static_library
end

标签: iosswiftcocoapods

解决方案


推荐阅读