在Cocoapods库中找不到类别 [英] Category not found in Cocoapods library
问题描述
我正在发布我的CocoaPods库的新版本。在此版本中,我加入了 UIDevice-Hardware.h 类别。
I am releasing a new version of my CocoaPods library. In this version I included the UIDevice-Hardware.h category.
我知道使用 -ObjC
标志在静态库中导入类别。在构建阶段->复制标题
, UIDevice-Hardware.h
位于项目中。
I am aware of the use of the -ObjC
flag to import categories in static libraries. In Build Phases -> Copy Headers
, UIDevice-Hardware.h
is in 'Project'.
何时我运行 pod lib lint --no-clean
,我以为会设置 -ObjC
标志,但是我得到了错误:
When I run pod lib lint --no-clean
, I thought the -ObjC
flag would be set, but I get the error:
- ERROR | [xcodebuild]
TCBlobDownload/TCBlobDownload/TCBlobDownload/TCBlobDownloader.m:16:9: fatal error:
'UIDevice-Hardware.h' file not found
Pods project available at `/private/tmp/CocoaPods/Lint/Pods/Pods.xcodeproj` for inspection.
所以我在 .podspec
:
spec.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -all_load -force_load' }
是的,所有三个标志,请确保。
Yeah, all three flags, just to be sure.
我仍然遇到相同的错误。我检查了说的 Pods.xcodeproj
,在它的目标中,其他链接器标记
为空,没有 -ObjC
或其他任何内容。但是 .xcconfig
文件在 .podspec
中定义了我的标志...我不知道要去哪里从那开始。
And I still got the same error. I checked the said Pods.xcodeproj
and in it's target, Other Linker Flags
is empty, no -ObjC
or anything else. But the .xcconfig
files have my flags defined in the .podspec
... I don't know where to go from that.
当我在设置了标记的测试项目中导入该库时,该库会很好地构建。
推荐答案
我的头文件是否由您的全局文件拾取,以说出哪个?要包含在广告连播中的文件?听起来规范似乎根本不包含该文件。
Is the header file picked up by your glob to say which files to include in the pod? Sounds like the spec simply isn't including the file.
这篇关于在Cocoapods库中找不到类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!