【iOS 】swift项目使用pod引入百度地图oc库时找不到头文件

由于最近开发一个项目,需要用到百度地图API,于是使用pod添加了百度地图的库,podfile如下:

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

target 'BaiduLocTest' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

  # Pods for BaiduLocTest
 pod 'BMKLocationKit','1.2.1'
 pod 'BaiduMapKit','4.1.1'
 pod 'SnapKit','~>4.0.0'
  target 'BaiduLocTestTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'BaiduLocTestUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

新建桥接文件-配置桥接文件路径-import头文件,报错:找不到头文件,如下图:
这里写图片描述
文件目录的确是有对应的头文件的。
于是找到百度地图的demo看了一下,发现import头文件的前缀不是BaiduMapKit,而是BaiduMapAPI_XXX。打开pods/BaiduMapKit才发现里面出了头文件还有一个framework文件夹,而里面放的就是编译出来的.framework文件,文件名正好对应前缀。于是找到要用头文件所属framework,用framework名作前缀就没问题了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值