Pod spec私有庫集成遇到的錯誤(二)

  • ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.xcodebuild
    編譯沒有通過

私有庫中依賴私有庫

本地驗證善茎、遠端驗證

pod lib lint HYVideoPlayerKit.podspec --sources=索引倉庫地址,https://github.com/CocoaPods/Specs.git --verbose --allow-warnings
Unable to find a specification for `HYVideoPlayerKit` depended upon by `HYEditVideoKit`


Framework not found EasyDarkMode

刪除重新編譯
Build Settings 找到Other Linker Flags中找到你的那個XXXX框架然后刪除省有,重新編譯就可以成功骗爆。

異常:XCode編譯出錯異常:ld: framework not found Kernel clang: error: linker command failed with e.......
解決辦法:

Targets->Build Setting->Linking->Match-o-Type ,修改為Static Library,再次編譯,編譯成功枉昏。

https://blog.csdn.net/qq_40697071/article/details/99055070



Command /bin/sh failed with exit code 1
本地腳本編譯出錯

  1. 選中項目 -> TARGETS->Build Phases-> “Bundle React Native code and images”

2.勾選 “Run script only when installing”


image.png


“CFBundleExecutable” is not specified
“CFBundleExecutable” specifies a file that is not executable

HYPhotoLibraryKit_Example.app does not contain a valid Info.plist, so it cannot be installed on “Bill”的 iPhone (2)
(“CFBundleExecutable” specifies a file that is not executable)

image.png


ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/EasyDarkMode'
ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/HYBasicToolKit'
ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/HYPhotoLibraryKit'
ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/HYVideoPlayerKit'
ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/SDWebImage'
ld: warning: directory not found for option '-F/Users/jiangweidong/Library/Developer/Xcode/DerivedData/HYPhotoLibraryKit-ffxhyajjfaekfggrljgbkkndupve/Build/Products/Debug-iphoneos/XHNetworkCache'
ld: framework not found EasyDarkMode
clang: error: linker command failed with exit code 1 (use -v to see invocation)

image.png

https://blog.csdn.net/longshihua/article/details/78054446

很奇怪干花,為什么已經(jīng)從項目中刪除了文件和文件夾還是報這個警告呢妄帘?

去掉警告的辦法如下:

1.選擇工程, 編譯的 (targets)

2.選擇 Build Settings 菜單

3.查找 Library Search Paths 和 Framework Search Paths, 刪掉編譯報warning的路徑即OK



ld: framework not found ***

進入Build Settings
搜索OTHER LINKER FLAGS
-framework這個標志是給你帶.framework的文件使用的池凄,所以你需要找出來那些不需要-framework的框架抡驼,把它下面的-framework刪除掉。



dyld: Library not loaded: @rpath/EasyDarkMode.framework/EasyDarkMode
Referenced from: /private/var/containers/Bundle/Application/92D0BF75-B0DF-48AD-9439-A70DD4D8DD59/HYPhotoLibraryKit_Example.app/HYPhotoLibraryKit_Example
Reason: image not found
dyld: launch, loading dependent libraries
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib

解決方案:在Podfile中肿仑,注釋use_frameworks!后致盟,重新執(zhí)行pod install。



podspec 驗證的時候 報錯

  • ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
  • NOTE | xcodebuild: clang: error: linker command failed with exit code 1 (use -v to see invocation)
image.png
image.png

如果私有庫添加了靜態(tài)庫或者dependency用了靜態(tài)庫
那么執(zhí)行pod lib lint還有pod spec lint時候需要加上—user-libraries選項
否則會出現(xiàn)'The 'Pods' target has transitive dependencies錯誤尤慰。

http://www.reibang.com/p/bdb1db6c9db4/

pod spec 驗證發(fā)布時的參數(shù)

Usage:

    $ pod lib lint [PODSPEC_PATHS ...]

      Validates the Pod using the files in the working directory.

Options:
 --quick                                  Lint skips checks that would require to
                                             download and build the spec
    --allow-warnings                         Lint validates even if warnings are
                                             present
    --subspec=NAME                           Lint validates only the given subspec
    --no-subspecs                            Lint skips validation of subspecs
    --no-clean                               Lint leaves the build directory intact
                                             for inspection
    --fail-fast                              Lint stops on the first failing platform
                                             or subspec
    --use-libraries                          Lint uses static libraries to install the
                                             spec
    --use-modular-headers                    Lint uses modular headers during
                                             installation
    --use-static-frameworks                  Lint uses static frameworks during
                                             installation
    --sources=https://cdn.cocoapods.org/     The sources from which to pull dependent
                                             pods (defaults to
                                             https://cdn.cocoapods.org/). Multiple
                                             sources must be comma-delimited
    --platforms=ios,macos                    Lint against specific platforms (defaults
                                             to all platforms supported by the
                                             podspec). Multiple platforms must be
                                             comma-delimited
    --private                                Lint skips checks that apply only to
                                             public specs
    --swift-version=VERSION                  The `SWIFT_VERSION` that should be used
                                             to lint the spec. This takes precedence
                                             over the Swift versions specified by the
                                             spec or a `.swift-version` file
    --include-podspecs=**/*.podspec          Additional ancillary podspecs which are
                                             used for linting via :path
    --external-podspecs=**/*.podspec         Additional ancillary podspecs which are
                                             used for linting via :podspec. If there
                                             are --include-podspecs, then these are
                                             removed from them
    --skip-import-validation                 Lint skips validating that the pod can be
                                             imported
    --skip-tests                             Lint skips building and running tests
                                             during validation
    --test-specs=test-spec1,test-spec2,etc   List of test specs to run
    --analyze                                Validate with the Xcode Static Analysis
                                             tool
    --configuration=CONFIGURATION            Build using the given configuration
                                             (defaults to Release)
    --allow-root                             Allows CocoaPods to run as root
    --silent                                 Show nothing
    --verbose                                Show more debugging information
    --no-ansi                                Show output without ANSI codes
    --help                                   Show help banner of specified command

–use-libraries使用靜態(tài)庫馏锡,如果在工程中使用到了靜態(tài)庫,但不在編譯的時候加上這句話伟端,就不能編譯通過眷篇。如果私有庫中存在.a文件,那么必須加上這個后綴荔泳。
–allow-warnings允許警告,警告可能會導致編譯不能通過虐杯,一般需要加上它玛歌。
–sources=BIFaceSDK,BIEncrypt說明庫的依賴關系,這里說明了庫依賴于BIFaceSDK,BIEncrypt這兩個pods擎椰。
–skip-import-validation和–skip-tests這兩個命令可以跳過部分驗證環(huán)節(jié)支子,如果發(fā)現(xiàn)工程怎么都lint不過,那么可以嘗試一下這個达舒。

需要注意的地方:
–skip-import-validation和–skip-tests
這樣操作之后值朋,確實可以實現(xiàn)pod的更新,但是最終工程中的pod可能會發(fā)生丟失部分文件巩搏,找不到索引等意外昨登。因此,還是要謹慎操作哈贯底!



經(jīng)典錯誤 - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.

9C72DBF8-026C-49A0-9311-E435073DE805.png

這次報錯事因為再依賴三方庫中有靜態(tài)庫丰辣,而三方的阿里云只支持真機架構(gòu)
所以在 .podspec中添加指定的架構(gòu)

s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
  s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }

這個問題真的是很令人頭疼,折騰了兩天,也看了網(wǎng)上的一些解決辦法笙什,包括StackOverFlow飘哨,有成功的也有不成功的,成功的我也覺得不是最佳琐凭。我就去翻CocoaPods GitHub Issues芽隆,終于讓我翻到了。

8129這個問題在 CocoaPods 1.6.0.beta.2 版本得到了修復

  1. 先升級到CocoaPods Beta版

    $ sudo gem install -n /usr/local/bin cocoapods --pre
    
    
  2. 編輯podspec统屈,加入 pod_target_xcconfig

    s.pod_target_xcconfig = { 'VALID_ARCHS' => 'arm64 armv7 x86_64' }
    
    

    什么是 pod_target_xcconfig ?

    Any flag to add to the final private pod target xcconfig file.
    要添加到最終私有pod目標xcconfig文件的任何標志胚吁。



CocoaPods 常規(guī)error https://github.com/CocoaPods/CocoaPods/issues/



獲取圖片資源路徑
參考
http://www.reibang.com/p/e772b0713f9a



Showing Recent Errors Only
Undefined symbol: _Decoder_Interface_init

私有庫中包含有第三方的靜態(tài)庫。
解決辦法需要在 podspec中添加:靜態(tài)庫的絕對路徑

s.vendored_libraries = 'HYKeyboardKit/Classes/RecordAudio/BlazeiceAudio/voiceConvert/lib/*.{a}'
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末鸿吆,一起剝皮案震驚了整個濱河市囤采,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌惩淳,老刑警劉巖蕉毯,帶你破解...
    沈念sama閱讀 217,657評論 6 505
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異思犁,居然都是意外死亡代虾,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,889評論 3 394
  • 文/潘曉璐 我一進店門激蹲,熙熙樓的掌柜王于貴愁眉苦臉地迎上來棉磨,“玉大人,你說我怎么就攤上這事学辱〕巳浚” “怎么了?”我有些...
    開封第一講書人閱讀 164,057評論 0 354
  • 文/不壞的土叔 我叫張陵策泣,是天一觀的道長衙傀。 經(jīng)常有香客問我,道長萨咕,這世上最難降的妖魔是什么统抬? 我笑而不...
    開封第一講書人閱讀 58,509評論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮危队,結(jié)果婚禮上聪建,老公的妹妹穿的比我還像新娘。我一直安慰自己茫陆,他們只是感情好金麸,可當我...
    茶點故事閱讀 67,562評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著盅弛,像睡著了一般钱骂。 火紅的嫁衣襯著肌膚如雪叔锐。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,443評論 1 302
  • 那天见秽,我揣著相機與錄音愉烙,去河邊找鬼。 笑死解取,一個胖子當著我的面吹牛步责,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播禀苦,決...
    沈念sama閱讀 40,251評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼蔓肯,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了振乏?” 一聲冷哼從身側(cè)響起氨肌,我...
    開封第一講書人閱讀 39,129評論 0 276
  • 序言:老撾萬榮一對情侶失蹤汞扎,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體沥阱,經(jīng)...
    沈念sama閱讀 45,561評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡捞挥,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,779評論 3 335
  • 正文 我和宋清朗相戀三年兼蕊,在試婚紗的時候發(fā)現(xiàn)自己被綠了果正。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 39,902評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡忆谓,死狀恐怖裆装,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情倡缠,我是刑警寧澤哨免,帶...
    沈念sama閱讀 35,621評論 5 345
  • 正文 年R本政府宣布,位于F島的核電站昙沦,受9級特大地震影響铁瞒,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜桅滋,卻給世界環(huán)境...
    茶點故事閱讀 41,220評論 3 328
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望身辨。 院中可真熱鬧丐谋,春花似錦、人聲如沸煌珊。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,838評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽定庵。三九已至吏饿,卻和暖如春踪危,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背猪落。 一陣腳步聲響...
    開封第一講書人閱讀 32,971評論 1 269
  • 我被黑心中介騙來泰國打工贞远, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人笨忌。 一個月前我還...
    沈念sama閱讀 48,025評論 2 370
  • 正文 我出身青樓蓝仲,卻偏偏與公主長得像,于是被迫代替她去往敵國和親官疲。 傳聞我的和親對象是個殘疾皇子袱结,可洞房花燭夜當晚...
    茶點故事閱讀 44,843評論 2 354

推薦閱讀更多精彩內(nèi)容