carloabelli
carloabelli

Reputation: 4349

Declare Architecture in Podfile

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.

My current Podfile:

xcodeproj 'Nobles/Nobles.xcodeproj'

platform :ios, '7.0'

pod 'Reachability'
pod 'TWTSideMenuViewController'

Upvotes: 3

Views: 7969

Answers (2)

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

Resolving CocoaPods build error due to targets building for only active architecture

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).

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

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

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

Maybe this can help you?

Upvotes: 4

TotoroTotoro
TotoroTotoro

Reputation: 17622

CocoaPods can't do what you want. It can give you different versions of the library, but it doesn't know anything about how that library was built.

Run xcrun -sdk iphoneos lipo -info libYourLibraryName.a to see which architectures it was built for.

If this is an open-source library, you can build it yourself, instead of just linking the .a file. If you don't have access to the library source, and the .a file doesn't include the 64 bit slice, I'm afraid you're out of luck. Contact the developer and ask them to build the library with the 64 bit support.

Upvotes: 0

Related Questions