CocoaPods podspec lint error - file not found

I am trying to distribute my module, but I have problems with checking it.

When I try to impose my .podspec, I get:

- ERROR | [iOS] [xcodebuild] path/to/my/source/file.m:14:9: fatal error: 'KeyValueObjectMapping/DCKeyValueObjectMapping.h' file not found 

I tried to keep the path to my structure with various options, for example

  s.preserve_paths = 'KeyValueObjectMapping.framework/*' 

or

  s.preserve_paths = '${PODS_ROOT}/Vendor/KeyValueObjectMapping/KeyValueObjectMapping.framework' 

& other options, but this way I get another error:

  - ERROR | [iOS] The `preserve_paths` pattern did not match any file. 

I also tried other things that I saw on other issues, for example:

  s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Vendor/KeyValueObjectMapping/KeyValueObjectMapping.framework"','FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/Vendor/KeyValueObjectMapping/*"' } s.framework = 'KeyValueObjectMapping' 

The project builds fine with Xcode5 and with xcodebuild with its default setting, I only get this problem when checking it for Cocoapods.

+7
ios objective-c cocoapods xcodebuild
source share
1 answer

I ran into this problem while trying to create my own Podspec and add RevMob and Heyzap SDK as dependencies.

I kept getting the following error:

 - ERROR | [iOS] [xcodebuild] MyProject/MyProjectSubDir/AnotherDir/CustomAd.h:10:9: fatal error: 'RevMobAds/RevMobAds.h' file not found - ERROR | [iOS] [xcodebuild] MyProject/MyProjectSubDir/AnotherDir/FacebookController.m:18:9: fatal error: 'RevMobAds/RevMobAds.h' file not found 

Then, when I specified FRAMEWORK_SEARCH_PATHS for RevMob, I would get the same error, but for the Heyzap SDK.

The solution for me was to create a routine and specify the search paths for each of the SDKs giving me problems. Here:

 s.subspec "Heyzap" do |ss| ss.dependency "Heyzap", "~> 6.4.4" ss.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/Heyzap"} end s.subspec "RevMob" do |ss| ss.dependency "RevMob", "~> 7.4.8" ss.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/RevMob"} end 

My pod spec lint now starts and builds without errors.

+3
source share

All Articles