0

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?

thibaultcha
  • 1,320
  • 2
  • 15
  • 27
  • 1
    Is the header file picked up by your glob to say which files to include in the pod? – Paul.s Mar 08 '14 at 15:44
  • @Paul.s Thanks for this comment, it just helped me to solve it. Since I placed this category in a subfolder, I replaced `spec.source_files = 'TCBlobDownload/TCBlobDownload/*.{h,m}'` with `TCBlobDownload/TCBlobDownload/**/*.{h,m}` and it's fixed. Dumb. Thank you! – thibaultcha Mar 08 '14 at 15:51

1 Answers1

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.

Paul.s
  • 38,494
  • 5
  • 70
  • 88