04.Podfile常见使用方法

1. 常规使用方法

platform :ios, '9.0'

target 'xxxx' do

pod 'RxCocoa', '~> 4.1.0'

end


2. 使用本地或者自建的库

source 'https://github.com/CocoaPods/Specs.git'
source 'git@xxxxxxxx.git'

3. 如何直接引用本地还未上传至POD库的资源

# 目录地址就是podspec文件的位置的相对位置
pod 'xxxx', :path => '../xxxx'

4. podfile 常用引入pod方式


pod '库名', :podspec => 'podspec文件路径'  #指定导入库的podspec文件路径

pod '库名', :git => '源码git地址'  #指定导入库的源码git地址

pod '库名', :tag => 'tag名'  #指定导入库的Tag分支

pod '库名', :path => '~/Documents/AFNetworking'  #指定本地的某个库,文件夹中要有podspec文件


5. 关于podspec中引入的工程bitcode问题

如果pod我们通过pod '库名', :path => '~/Documents/AFNetworking' 引入,但是目标文件中有些文件不支持bitcode,如果直接引入,报错

'xxxx' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target.

设置bitcode为NO也不管用

解决方案:

在podspec 中加入

s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' } 即可

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

推荐阅读更多精彩内容