Cocoa pods相關
clang: error: linker command failed with exit code 1 (use -v to see invocation)
環境:
macOS: 10.12.6
Xcode: 8.3.3
cocoa pods version: 1.3.1
Podfile:
platform :ios, '9.0'
use_frameworks!
過程:
Case 1:
當我從我的Podfile刪掉一個庫,并重新pod install,在build項目時遇到報錯:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
google了一下,此處提示說:一般是因為項目找不到cocoapods 的庫,按照這個思路我在項目的Build Setttings/Other Linker Flags里找到了我刪掉的這個庫,刪掉以后重新build,報錯消失。
Case 2:
我在有一個項目中使用了激光推送, 并且該項目代碼還是使用svn管理。一開始我使用cocopods安裝使用,但是當我將代碼上傳svn供同事使用時,項目不能成功build,報錯:
Apple Mach-O Linker Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
經過排查發現是因為pods中激光推送的靜態庫.a文件丟失,這是svn管理工具的bug。這里我的處理方法是直接在terminal里手動將.a庫文件加入上傳:
// xxxxx為庫文件名
$ svn add xxxxx.a
持續更新中...