Xcode 6 iOS Creating a Cocoa Touch Framework - Architectures issues
cocoa, dynamic-library, ios-universal-framework, ios8, xcode6
Solution
Sorry I've let this topic open for such a long time... Some of you has correctly answered to my question. When I wrote this question I didn't catch there were two slices in a complete (also called fat) framework (ready to use). One for the iOS devices and one for the simulator. When I discovered that I made a script using lipo command to fusion the two slices and got automatically a complete framework.
Problem
I'm trying to make a dynamic framework for an iOS app. Thanks to the new version of Xcode (6) we can select a Cocoa Touch Framework when we create a new project and there is no more need to add an aggregate target, run script and so to make one. I have no issue when i build the framework. But when I'm trying to use it inside an iOS app I get some architectures issues. ``` ld: warning: ignoring file /Library/Frameworks/MyFramework.framework/MyFramework, file was built for x86_64 which is not the architecture being linked (arm64): /Library/Frameworks/MyFramework.framework/MyFramework Undefined symbols for architecture arm64: "_OBJC_CLASS_$_MyFrameworkWebService", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ld: warning: ignoring file /Library/Frameworks/MyFramework.framework/MyFramework, file was built for x86_64 which is not the architecture being linked (armv7): /Library/Frameworks/MyFramework.framework/MyFramework Undefined symbols for architecture armv7: "_OBJC_CLASS_$_MyFrameworkWebService", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` Well I have tried to change the settings of the framework project and target (Architectures & Build valid architecture only & Valid architectures). I've done the same thing for the iOS app project but nothing works. I think there is something I didn't understand. For example when I build a framework for only i386 (iOS Simulator) check with the command line "xcrun lipo -info MyFramework", I have an issue that ld: warning: ignoring file /Library/Frameworks/MyFramework.framework/MyFramework, file was built for x86_64 which is not the architecture being linked (i386)... If someone can help me to get a framework that works for all iOS architectures including simulators.
Related problems
- Building pure Swift Cocoa Touch Framework
- Library? Static? Dynamic? Or Framework? Project inside another project
- merge static libraries into single
- Creating iOS/OSX Frameworks: is it necessary to codesign them before distributing to other developers?
- xcframework does not contain internal frameworks
- When and how to use Aggregate Target in xcode 4
- How do I create an importable module in Swift?