gpt4 book ai didi

ios - 支持的平台、基础 SDK、仅构建事件架构设置在 pod 更新后恢复

转载 作者:可可西里 更新时间:2023-11-01 04:25:30 25 4
gpt4 key购买 nike

我的团队最近开始使用 CocoaPods 来管理我们 iOS 应用项目中的依赖项。

这是播客文件:

platform :ios, '6.0'

pod "UI7Kit"
pod "AFNetworking", "~> 2.0"
pod "TMCache"
pod "SVProgressHUD"
pod "SVPullToRefresh"

但是使用CocoaPods后,iPhone 5的build target总是失败,但是simulator可以成功。

这是错误日志:

ld: warning: ignoring file [DerivedData directory]/libPods.a, file was built for archive which is not the architecture being linked (armv7): [DerivedData directory]/libPods.a
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_SVProgressHUD", referenced from:
objc-class-ref in ....o
"_OBJC_CLASS_$_TMCache", referenced from:
objc-class-ref in ....o
"_OBJC_CLASS_$_UI7Kit", referenced from:
objc-class-ref in ....o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我已经尝试过 CocoaPods Troubleshooting 中提到的解决方案,包括在列表顶部添加 Pods 静态库,但它仍然失败。

后来我们发现在“Pods Project Settings”>“Build Settings”>“Architectures”中,“Base SDK”设置为“No SDK (Latest OS X)”,“Build Active Architecture Only”>“Debug”设置为"is",“支持的平台”设置为“OS X”。将它们分别更改为“Latest iOS (iOS 7.0)”、“No”、“iOS”后,为 iPhone 5 和模拟器构建都可以正常工作。

但是,每次我们执行 Pod update 时,所有三个设置都会恢复到之前的状态,这很烦人。

我的问题是:

  1. 这种情况是设计使然还是我的项目/工作区设置有问题?
  2. 如何防止这些设置恢复到错误的状态?

我们将不胜感激。

最佳答案

CocoaPods issues 中所述,您可以将其附加到您的 Podfile 中:

post_install do |installer_representation|
installer_representation.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end

这将使所有 pod 为所有 arch 构建。

关于ios - 支持的平台、基础 SDK、仅构建事件架构设置在 pod 更新后恢复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20464183/

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