在Podfile中声明架构 [英] Declare Architecture in Podfile

查看:75
本文介绍了在Podfile中声明架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在CocoaPods Podfile 中包含该体系结构?我正在尝试同时为32位和64位构建应用程序,但是当我在项目的构建设置中切换到标准体系结构(包括64位)时,它抱怨我应该让它自动选择体系结构.这样做会将我的项目还原为 Standard体系结构.我感觉Xcode正在这样做,因为Pods项目(在我的Xcworkspace中)在其体系结构中不包括64位.有没有一种方法可以将其添加到 Podfile 中(如果Pod自己做的话,我认为更好),或者也应该在Pods项目中更改它.

Is there a way to include the architecture in a CocoaPods Podfile? I am trying to build my app for both 32 and 64 bit but when I switch to Standard architectures (including 64-bit) in my project's build settings, it complains that I should let it automatically choose architectures. Doing this reverts my project back to Standard architectures. I have a feeling that Xcode is doing this because the Pods project (in my Xcworkspace) does not include 64-bit in its architectures. Is there a way to add this to the Podfile(I assume better if Pod does it itself) or should I change it in the Pods project as well.

我当前的 Podfile :

xcodeproj 'Nobles/Nobles.xcodeproj'

platform :ios, '7.0'

pod 'Reachability'
pod 'TWTSideMenuViewController'

推荐答案

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

I'm searching for answers to a similar issue and found this:

安装Pod之后,我始终会遇到构建错误,因为默认情况下,CocoaPods会将您的Pod配置为仅针对活动架构进行构建(调试期间).

I always have a build error after pod install, because by default, CocoaPods will configure your pods to build for active architecture only (during debugging).

解决方案是将Pods项目设置仅将Active Active Architecture建立为调试"更改为"NO".

The solution is to change Pods project setting Build Active Architecture Only to NO for debug.

但是每次运行pod install之后进行更改都是很繁琐的(因为更改将恢复为YES).

But it is tedious to change every time after you run pod install (as your change will get reverted back to YES).

msmollin在CocoaPods问题中建议,您可以通过以下方式解决:

As suggested by msmollin in CocoaPods issues, you can fix by with:

# 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

也许这可以帮助您?

这篇关于在Podfile中声明架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆