cocoapods錯誤總結

1 報錯:Pods written in Swift can only be integrated as frameworks; add use_frameworks! to your Podfile or target to opt into using it. The Swift Pods being used are: ReactiveCocoa, ReactiveSwift, and Result

解決:在想應的pod 'ReactiveCocoa'下添加use_frameworks!git

ps:注意use_frameworks!後面的!號github

2 集成cocoapods的時候報錯:'xxx' file not found with include; use "quotes" instead

解決:引用路徑的問題,更改引用路徑。例如:#import <JSONModel.h>,改爲#import <JSONModel/JSONModel.h> 就能夠了ide

3 集成cocoapods的時候報錯:include of non-modular header inside framework module 'XXX': 'XXX' [-Werror,-Wnon-modular-include-in-framework-module]

解決:引用路徑的問題,更改引用路徑。例如:#import "JSONModel.h",改爲#import <JSONModel/JSONModel.h> 就能夠了code

4 集成cocoapods的時候報錯:include of non-modular header inside framework module 'XXX': 'XXX' [-Werror,-Wnon-modular-include-in-framework-module]

解決:若是第3條解決不了,在pod spec lint後添加--use-libraries。同時在pod trunk push 或者pod repo push 【私有庫】的後添加--use-librariesci

--use-libraries表示使用靜態庫或者是framework,這裏主要是解決當咱們依賴一些framework庫後校驗提示找不到庫的時候用到。get

5 集成cocoapods的時候報錯:Encountered an unknown error (Unable to find a specification for xxx depended upon by xxx

解決:在集成cocoapods的時候添加私有或者公有或者二者都有的sources。如公有的sources。pod repo push xiaofengCocoapodsRepo --sources=https://github.com/CocoaPods/Specs.gitit

相關文章
相關標籤/搜索