Cocoapods 私有库制做填坑指南(Weex、支付宝SDK、微信SDK)

一、 私有库指定 sources Git目录

pod lib lint OCompPay.podspec --allow-warnings --use-libraries --sources="https://gitlab.oneitfarm.com/tanhui/CiNetwork.git,https://github.com/CocoaPods/Specs.git,https://gitlab.oneitfarm.com/tanhui/CiUtil.git,https://gitlab.oneitfarm.com/tanhui/CiBaseComponent.git,https://gitlab.oneitfarm.com/luliangxiao/ocomp-native.git" --verbose
复制代码

二、 添加 frameworks 和 libraries

s.frameworks = 'CFNetwork', 'CoreMotion', 'Foundation', 'CoreGraphics', 'SystemConfiguration', 'UIKit', 'CoreText', 'QuartzCore', 'CoreTelephony'
     s.libraries = 'z', 'sqlite3.0', 'c++'
复制代码

三、 支付宝 指定 header 路径

s.header_dir = "openssl"
复制代码

四、 支付宝、微信指定 .a 和 .frameworks 路径

s.vendored_frameworks = 'OCompPay/ThirdSDK/aliPay_SDK_2.0/AlipaySDK.framework'
     s.vendored_libraries = 'OCompPay/ThirdSDK/aliPay_SDK_2.0/libcrypto.a', 'OCompPay/ThirdSDK/aliPay_SDK_2.0/libssl.a'
     s.vendored_libraries = 'OCompPay/ThirdSDK/Wechat_SDK_1.6.2/libWeChatSDK.a'
复制代码

五、 Weex的使用

--use-libraries 须要添加这条命令,由于 weex 是 静态库;
复制代码

六、 指定须要用的资源库

s.resource_bundles = {
  'CIWebView' => [ 'iOS/Source/CIWebView/bundlejs/web.js']
}
复制代码

七、 source_files 目录 ** 表现遍历下面全部的子目录的文件

八、 提交完成以后若是 搜索不到能够更新一下 pod

pod setup
复制代码

9 制做的库中若是存在私有库,podfile 中须要 添加 podspec 中的私有库source,公有库 pods 会自动安装,可是私有库没法找到对应的路径

十、 遇到的报错以及解决方案:

Error Info:Unable to find a specification for depended upon by Reason:未添加私有库Git路径c++

Error Info: linker command failed with exit code 1 (use -v to see invocation Reason:git

1 文件名重复,检查是否有命名重复的文件github

2 未添加须要依赖的 librariesweb

pod lib lint OCompConversation OCompConversation.podspec --sources=https://gitlab.oneitfarm.com/tanhui/CiNetwork.git,https://github.com/CocoaPods/Specs.git,https://gitlab.oneitfarm.com/tanhui/CiUtil.git,https://gitlab.oneitfarm.com/tanhui/CiBaseComponent.git,https://gitlab.oneitfarm.com/luliangxiao/ocomp-native.git --allow-warnings --use-libraries

pod lib lint
复制代码
相关文章
相关标签/搜索