gpt4 book ai didi

objective-c - Podspec 模式包括未在 source_files 中列出的头文件

转载 作者:行者123 更新时间:2023-11-28 07:37:28 25 4
gpt4 key购买 nike

我正在尝试创建一个 Cocoapod。但是,当我运行 pod lib lint 时,出现以下错误:

MyCoolProject (1.0.0)
- ERROR | [iOS] public_header_files: The pattern includes header files that are not listed in source_files

然后它列出了我所有的 .h 文件。 (为简洁起见删除了一些)

/Users/myusername/Documents/GitHub/MyCoolProject/Pod/Classes/Objective-C/MyCoolProject.h,
/Users/myusername/Documents/GitHub/MyCoolProject/Pod/Classes/Objective-C/MyCoolProjectConstants.h,
/Users/myusername/Documents/GitHub/MyCoolProject/Pod/Classes/Objective-C/MyCoolProjectEnums.h,
/Users/myusername/Documents/GitHub/MyCoolProject/Pod/Classes/Objective-C/MyCoolProjectMacros.h,
/Users/myusername/Documents/GitHub/MyCoolProject/Pod/Classes/Objective-C/MyCoolProject_.h,
/Users/myusername/Documents/GitHub/MyCoolProject/Pod/Classes/Objective-C/UIView+MyCoolProjectPrivate.h,
/Users/myusername/Documents/GitHub/MyCoolProject/Pod/Classes/Objective-C/UIViewController+MyCoolProject.h

我花了 2 天时间,找到 0 条有助于我理解和更正错误的信息。 任何人都可以阐明我可能做错了什么吗?

这是我的 podspec 文件

Pod::Spec.new do |s|
s.name = "MyCoolProject"
s.version = "1.0.0"
s.summary = "Color Framework for iOS (Obj-C & Swift)"
s.homepage = "https://github.com/myusername/MyCoolProject"

s.license = { :type => "MIT", :file => "LICENSE.md" }
s.author = "My Name"

s.platform = :ios
s.ios.deployment_target = '8.0'
s.source = { :git => "https://github.com/myusername/MyCoolProject.git",
:tag => s.version.to_s }

s.public_header_files = 'Pod/Classes/Objective-C/**/*.h'
s.frameworks = 'UIKit', 'QuartzCore', 'CoreGraphics'

s.default_subspecs = 'Default'

s.subspec 'Default' do |ss|
ss.source_files = 'Pod/Classes/Objective-C/**/*.{h,m}'
end

s.subspec 'Swift' do |ss|
ss.ios.deployment_target = '8.0'
ss.source_files = 'Pod/Classes/Swift/MyCoolProjectShorthand.swift'
ss.dependency 'MyCoolProject/Default'
end
end

正如您从我的屏幕截图中看到的那样,所有文件都在那里:

enter image description here

最佳答案

public_header_files 声明移动到 Default 子规范中会有所不同吗?或者将 source_files 移动到外部范围?

我怀疑 CocoaPods 在处理其依赖项之前正在检查文件中的 Swift 子规范。

关于objective-c - Podspec 模式包括未在 source_files 中列出的头文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53014816/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com