問題描述
Xcode 編譯工程時輸出如下錯誤
Showing All Errors Only
Undefined symbol: functionA(char const*, char const*)
其中 functionA(char const, char const) 方法為以CocoaPods 私有庫方式引入的 lib.a文件中的方法
問題排查
查看Xcode編譯日志,發(fā)現(xiàn)有如下提示
ld: warning: ignoring file /Users/XXX/Desktop/XXXXX/lib.a, building for iOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F )
問題解決
Step1:
如果lib.a文件以 CocoaPods Development Pods 引用,則進入該Pods所在目錄,執(zhí)行
git lfs pull
如果lib.a以Private Pods引入,則在 Podfile 所在目錄執(zhí)行
brew install git-lfs
Step2:
如果問題未解決,則清空 Pod 的緩存文件,使用如下命令
pod cache clean --all
或
pod cache clean 'XXXSDK'