Swift – Xcode 6.1: file was built for x86_64 which is not the architecture being linked (i386)

cocoacompilationframeworksswiftxcode

I've created a Swift framework project for util/extensions that compiles and copies a .framework file to a dedicated location on my system. I want to be able to include this file into other projects (Build Phases/Link Binary with Libraries). The framework project is a Cocoa Touch Framework type project (as selected from Xcode 6.1 project template browser).

But when I try compiling a project which links the framework file, I'm getting this warning:

ld: warning: ignoring file
/Users/name/Projects/Xcode/Libs/swiftutils.framework/swiftutils, file
was built for x86_64 which is not the architecture being linked
(i386):
/Users/name/Projects/Xcode/Libs/swiftutils.framework/swiftutils

Is there anything I can do with the framework project so that it is valid for other iOS projects? It's confusing because the framework project is a Cocoa Touch Framework project which should naturally work with other Cocoa Touch (i.e. IOS) projects, shouldn't it?

Best Answer

Make sure you have i386 and x86_64 listed in your Architectures in Build settings for your lib. Also set Build Active Architecture Only explicitly to No.