OC项目中用Cocoapods集成Swift库

新建了一个OC的项目
创建podfile,添加了这两项

pod 'web3swift', git: 'https://github.com/BANKEX/web3swift.git'
 pod 'KeychainAccess'

然后

pod install

报错

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `web3swift` depends upon `secp256k1_ios`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

解决:
在podfile中写上use_frameworks!

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

target 'wallet' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!
  pod 'web3swift', git: 'https://github.com/BANKEX/web3swift.git'
  pod 'KeychainAccess'
  # Pods for wallet

end

再次执行pod install,成功~

你可能感兴趣的:(OC项目中用Cocoapods集成Swift库)