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,成功~

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1 使用步骤 a、 新建一个项目,名字PodTest; b、终端中,cd到项目总目录(注意:包含PodTest文件...
    Kevin_Junbaozi阅读 6,850评论 0 3
  • CocoaPods 是开发 OS X 和 iOS 应用程序的一个第三方库的依赖管理工具。利用 CocoaPods,...
    宝山潇洒哥阅读 9,507评论 0 1
  • 一. CocoaPods的介绍 什么是CocoaPods?CocoaPods是一个负责管理iOS项目中第三方开源库...
    辉712阅读 9,399评论 0 7
  • CocoaPods 是什么? CocoaPods 是一个负责管理 iOS 项目中第三方开源库的工具。CocoaPo...
    朝洋阅读 25,828评论 3 50
  • 早起的鸟儿有虫吃。今天起得早,在花尖嫩芽上收了些雨露。相信总有一句会湿了你的眼,润了你的心。喜欢,就拿走,不客气!...
    杨博宁阅读 3,157评论 0 1