Category not found in Cocoapods library

限于喜欢 提交于 2019-12-20 06:28:40

问题


I am releasing a new version of my CocoaPods library. In this version I included the UIDevice-Hardware.h category.

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'.

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.

So I added this line in my .podspec:

spec.xcconfig = { 'OTHER_LDFLAGS' => '-ObjC -all_load -force_load' }

Yeah, all three flags, just to be sure.

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.

The library builds well when I import it in a test project in which I set the flag. How can I make it lint with CocoaPods?


回答1:


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.



来源:https://stackoverflow.com/questions/22271300/category-not-found-in-cocoapods-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!