美文网首页iOS
OC项目中用Cocoapods集成Swift库

OC项目中用Cocoapods集成Swift库

作者: 代码侯 | 来源:发表于2018-09-18 15:32 被阅读0次

    新建了一个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库

        本文链接:https://www.haomeiwen.com/subject/kslpnftx.html