gpt4 book ai didi

objective-c - Pod 安装后 Pod/标题为空

转载 作者:IT王子 更新时间:2023-10-29 05:38:23 44 4
gpt4 key购买 nike

问题

在最近的 pod install 运行之前,我的项目(完全工作的项目)中曾经有一组功能性的 Pod,现在我收到了中提到的 header 的“找不到文件”错误我的桥接头(这是一个包含 Obj-C 的 Swift 项目)。在做了一些研究之后,似乎应该有指向 Pods/Headers 中标题的符号链接(symbolic link),该目录对我来说是空的。但是,pods 本身已被下载并且所有相应的 Pods/[Lib] 目录都存在。

最后已知的良好状态

在这个错误开始发生之前,我所做的更改是为我引入的其中一个库指定 :git:commit 标志。然后我重新运行 pod install 并开始看到“找不到文件”错误。当时我用的是Cocoapods 0.39

当前状态

我尝试了其他堆栈溢出线程的一些解决方案,包括添加 User Header Search Paths,但没有效果(现在恢复到原来的状态),以及更新我的 cocoapods。我当前的 cocoapods 版本是 1.0.0.beta.6。除了我遇到的额外麻烦,例如必须重写我的 Podfile 的部分内容以符合新标准,我现在似乎回到了相同的状态(所有库都成功下载,但找不到 header )。

这是我如何在桥接 header 中包含 header 的示例:

// In this header, you should import all the public headers of your framework using statements like #import <MyKit/PublicHeader.h>
#import <CocoaLumberjack/CocoaLumberjack.h>

这是我的 Podfile 的样子(我试图将它精简以避免不相关的内容):

source 'https://github.com/CocoaPods/Specs'
platform :ios, '8.0'

use_frameworks!
pod 'CocoaLumberjack', '2.0.0'
pod 'SwiftyJSON', '~> 2.3'
pod 'Classy', :git => 'https://github.com/ClassyKit/Classy.git', :commit => 'c319908f8bded62e268dfd48ee5d65329b819129'

workspace 'my.work-ios'
project 'mywork' # sdk
project 'Examples/example1' # sample project using sdk
project 'my.work-ios.xcodeproj' # placeholder for main project, not really in use

target 'UnitTests' do
pod 'Specta'
pod 'Expecta'
pod 'OCMock'
pod 'OHHTTPStubs'
end

# Copy acknowledgements to the Settings.bundle
post_install do | installer |
require 'fileutils'

pods_acknowledgements_path = 'Pods/Target Support Files/Pods/Pods-Acknowledgements.plist'
settings_bundle_path = Dir.glob("**/*Settings.bundle*").first

if File.file?(pods_acknowledgements_path)
puts 'Copying acknowledgements to Settings.bundle'
FileUtils.cp_r(pods_acknowledgements_path, "#{settings_bundle_path}/Acknowledgements.plist", :remove_destination => true)
end

installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['OTHER_SWIFT_FLAGS'] = "-DLEGACY"
end
end
end

更新

经过更多的挖掘,我发现罪魁祸首是 use_frameworks! 命令,忽略它(并反过来删除 Swift 库,因为它们需要它)导致 Pods/Headers 将填充 PrivatePublic 目录,以及相关 header 的符号链接(symbolic link)。

在以前版本的 cocoapods 中情况并非如此,我仍在尝试了解发生了什么,因为省略该命令对我来说不是一个可用的解决方法(考虑到我在我的应用程序中使用的 Swift 库)。

更新2

这已经在评论中提到了,但为了方便起见,我也把它放在这里。这似乎是由该线程中报告的错误引起的:https://github.com/CocoaPods/CocoaPods/issues/4605#issuecomment-208822149 .该线程还建议了一些可能对某些人来说足够好的解决方法。对我来说,它们不是,所以我回到了 0.39。

最佳答案

你试过这个设置吗?

target 'TargetProject' do

pod 'CocoaLumberjack', '2.0.0'
pod 'SwiftyJSON', '~> 2.3'
pod 'Classy', :git => 'https://github.com/ClassyKit/Classy.git', :commit => 'c319908f8bded62e268dfd48ee5d65329b819129'

end

and have this '.swift-version' added? where it contains '3.0-GM-CANDIDATE'

我正在为 swift 3.0 使用这种设置

关于objective-c - Pod 安装后 Pod/标题为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36507504/

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