IOS pod 使用

背景:之前只是简单的使用flutter或自己创建一个工程简单的玩一下ios,最近打算使用一些第三方的公共库,就需要使用pod工具,在此记录下来。

1.安装cocoapods

sudo gem install cocoapods

2.进入工程目录下,使用pod

pod install

第一次安装需要时间比较长后面就会快一些

3.编译

下面以luaview为例,进行整体接入测试:

1.新建工程

2.在工程目录下执行 pod init

3.打开生成的Podfile文件,添加pod 依赖

target 'LuaViewDemo' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for LuaViewDemo

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

  target 'LuaViewDemoUITests' do
    inherit! :search_paths
    # Pods for testing
  end
pod 'LuaViewSDK', :git => 'https://github.com/alibaba/LuaViewSDK.git'

pod 'liblua', :git => 'https://github.com/alibaba/LuaViewSDK.git'

end

4.安装依赖文件,pod install

5.编译运行

错误问题1:该问题是找不到本地私有库中的类,配置路径也没有问题

Lexical or Preprocessor Issue '***.h' file not found

解决办法1:Build Settings->将代码路径加入的Header Search Paths中

解决办法2:将pod依赖关系删掉

platform :ios, "8.0"
use_frameworks!
target 'Demo' do

    pod 'MJRefresh'
    pod 'SDWebImage', '3.7.5'

#    pod 'LuaViewSDK', :path => '../../'
#    pod 'liblua',  :path => '../../'

end

将代码通过 右键-> Add Files to "Demo"

两种方法均能解决该问题

问题2:Error: The source control operation failed because the

每次打开文件的时候,都会弹框提示

解决办法:需要git add 这个文件,之后才能解决

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值