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
複製代碼
相關文章
相關標籤/搜索