使用AliyunLogObjc報錯
# 要先安裝 protobuf
brew install protobuf
# 安裝指定的版本
brew install protobuf@3.6
# 根據(jù)提示养盗,添加 protoc 到環(huán)境
echo 'export PATH="/usr/local/opt/protobuf@3.6/bin:$PATH"' >> ~/.zshrc
Xcode build error
這是因為AliyunLogObjc會使用 protobuf 生成代碼坚弱,而終端使用的protobuf版本摹芙,跟pod中在中依賴的protobuf版本不一致造成的
#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002
#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
#endif
#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
#endif
所以需要根據(jù)AliyunLogObjc.podspec中依賴去確定 protobuf 的版本,
這時需要先重新安裝protobuf
brew uninstall protobuf
brew install protobuf@3.6
然后刪除 cocoapods緩存
rm -rf Pods/AliyunLogObjc
pod cache clean AliyunLogObjc
最后 pod update