image.png
本篇主要讲在自己的
pod
库中,push遇到的一些常见错误和一些特殊设置
1)依赖错误
ERROR | [iOS] unknown: Encountered an unknown error (The 'Pods-App' target has transitive dependencies that include static binaries: (/private/var/folders/_r/rtmkt9590l7gkq8zscryyqz80000gn/T/CocoaPods-Lint-20180419-3650-1tkys6n-CBBase58/Pods/XXXXXXXXXXersal/lib-ios/libssl.a)) during validation.
这个错误是因为依赖库(s.dependency)包含了.a静态库造成的。虽然这并不影响Pod的使用,但是验证是无法通过的。可以通过 --use-libraries 来让验证通过。
pod spec lint xxxxx.podspec --verbose --use-libraries
- 依赖的第三方framework不支持ARC. 曾经在集成zoomSDK的过程中遇到过
s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' }
s.requires_arc = false
s.static_framework = true
s.xcconfig = {'OTHER_LDFLAGS' => '-ObjC'}
s.pod_target_xcconfig = { 'VALID_ARCHS' => 'x86_64 armv7 arm64' }
s.vendored_frameworks = 'MRZoomSDK/Classes/MobileRTC.framework'
3)引入第三方framework后不支持部分架构
可以利用lipo -info
命令来查看framework
支持的架构
lipo -info xxxx.framework
在podspec中写上支持的架构,比如有些framework就只支持真机也就是arm64
s.pod_target_xcconfig = { 'VALID_ARCHS' => 'arm64' }
4)需要xcode配置一些特殊参数,比如我遇到过需要配置'VALID_ARCHS' => 'arm64 arm64e',
s.xcconfig = {
'OTHER_LDFLAGS' => '-ObjC',
'VALID_ARCHS' => 'arm64 arm64e',
}