CocoaPods podspec皮棉故障-找不到文件 [英] CocoaPods podspec lint failure - file not found
问题描述
我正在尝试分发我的Pod,但是我在验证它时遇到了问题。
I'm trying to distribute my pod, but I'm having issues with it's validation.
当我尝试对.podspec进行抹布时,我会m得到:
When I'm trying to lint against my .podspec I'm getting:
- ERROR | [iOS] [xcodebuild] path/to/my/source/file.m:14:9: fatal error: 'KeyValueObjectMapping/DCKeyValueObjectMapping.h' file not found
我尝试通过各种变体来保留通往其框架的路径,例如
I tried to preserve the path to their framework with different variations like
s.preserve_paths = 'KeyValueObjectMapping.framework/*'
或
s.preserve_paths = '${PODS_ROOT}/Vendor/KeyValueObjectMapping/KeyValueObjectMapping.framework'
&其他变体,但是那样我又遇到一个错误:
& other variations but that way I'm getting one more error:
- ERROR | [iOS] The `preserve_paths` pattern did not match any file.
我还尝试了其他在其他问题上看到的其他事情,例如:
I also tried different other things which I saw on other issues like:
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Vendor/KeyValueObjectMapping/KeyValueObjectMapping.framework"','FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/Vendor/KeyValueObjectMapping/*"' }
s.framework = 'KeyValueObjectMapping'
该项目使用Xcode5&使用xcodebuild的默认设置,仅在验证Cocoapods时才遇到此问题。
The project builds fine with Xcode5 & with xcodebuild with it's default setup, I'm getting this issue only when validating it for Cocoapods.
推荐答案
尝试创建自定义Podspec并添加 RevMob 和 Heyzap SDK作为依赖项。
I was running into this issue trying to create a custom Podspec and add the RevMob and Heyzap SDKs as dependencies.
我一直收到以下错误:
- 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
然后,当我为RevMob指定FRAMEWORK_SEARCH_PATHS时,除了Heyzap的SDK外,我也会遇到相同的错误。
Then when I specified the FRAMEWORK_SEARCH_PATHS for RevMob, I would get the same error but for Heyzap's SDK.
解决方案我当时要创建一个子规格,并为每个给我问题的SDK指定搜索路径。在这里:
The solution for me was to create a subspec and specify search paths for each of the SDKs giving me issues. 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
我的 pod spec lint
现在可以运行&会正确构建。
My pod spec lint
now runs & builds without error.
这篇关于CocoaPods podspec皮棉故障-找不到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!