在Podfile中声明体系结构

有没有办法将体系结构包含在CocoaPods Podfile ? 我试图构build我的应用程序为32位和64位,但是当我在我的项目的构build设置切换到Standard architectures (including 64-bit) ,它抱怨我应该让它自动select体系结构。 这样做将我的项目恢复到Standard architectures 。 我有一种感觉,Xcode是这样做的,因为Pods项目(在我的Xcworkspace中)在其架构中不包括64位。 有没有办法将其添加到Podfile (我假设Pod自己做的更好)还是应该在Pods项目中更改它。

我目前的Podfile

 xcodeproj 'Nobles/Nobles.xcodeproj' platform :ios, '7.0' pod 'Reachability' pod 'TWTSideMenuViewController' 

cocoa豆不能做你想做的。 它可以给你不同版本的图书馆,但它不知道如何build立图书馆。

运行xcrun -sdk iphoneos lipo -info libYourLibraryName.a来查看它为其构build的体系结构。

如果这是一个开源库,您可以自己构build它,而不仅仅是链接.a文件。 如果您无法访问库源,并且.a文件不包含64位分片,恐怕您运气不好。 联系开发人员,并要求他们用64位支持构build库。

我正在寻找类似的问题的答案,并发现这一点:

解决CocoaPods构build错误,由于目标只为活动架构而构build

在pod安装之后,我总是有一个构build错误,因为默认情况下,CocoaPods会configuration你的pod,只为活动架构(在debugging过程中)构build。

解决方法是将Pods项目设置更改为仅将Build Active Architecture设置为NO以进行debugging。

但是运行pod安装后,每次更改都很繁琐(因为您的更改将恢复为YES)。

正如CocoaPods问题中的msmollin所build议的,您可以通过以下方式进行修复:

 # Append to your Podfile post_install do |installer_representation| installer_representation.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO' end end end 

也许这可以帮助你?