Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build active architecture only for CocoaPods needs to be NO in Xcode

In an old project where we use cocoapods, there is a strange problem since Xcode 6: when compiling for iphone (not simulator), some random cocoapods are not found while building (e.g. Flurry). In Xcode 5 everything is fine. This is with When 'Build active architecture only = YES' in the Cocoapods target.

When 'Build active architecture only = NO', everything works as expected.

Why is this? I've already rebuilt cocoapods a few times, but it keeps the same.

like image 766
brainray Avatar asked Oct 02 '14 12:10

brainray


People also ask

What is build active architecture only in Xcode?

The "build active architecture only" setting causes everything except the current Mac's architecture to be ignored (and the current one is of course valid), hiding the problem. Instead, you should look up a row or two in the settings, and change the "Architectures" setting to "Standard".

Where is build settings in Xcode?

Choose the project in the Project Navigator on the left. Select the Configurations target from the Targets section and click the Build Settings tab at the top. The Build Settings tab shows the build settings for the Configurations target. It's possible to expand this list with build settings that you define.

How do you add excluded architectures?

You can manually add the Excluded Architecture in your Pod project's Build Settings, but it will be overwritten when you use pod install . In place of this, you can add this snippet in your Podfile . It will write the necessary Build Settings every time you run pod install .


1 Answers

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
like image 138
Nahash Avatar answered Oct 04 '22 00:10

Nahash