Xcode 6 iOS Creating a Cocoa Touch Framework - Architectures issues

ios framework architecture
ios create framework with dependencies
convert xcode project to framework
create ios framework objective-c
xcode create framework
create universal framework xcode 11
xcode linked frameworks and libraries
add custom framework to xcode project

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.


Based on all the responses, the post on raywenderlich.com and the gist created by Chris Conway I came up with this.

Executing the following steps I was able to build a Cocoa Touch framework (including Swift and Objective-C files) that contains all architectures for both simulator and device:

  1. Create a new (Aggregate) target in your framework's project
  2. Under "Build Phases" select "Add Run Script" and copy the contents of this file
  3. Select the Aggregate target in the Scheme Selection drop down
  4. Build the target for the aggregate scheme

Hope it helps :)

UPDATE: Fixed an error in the gist where the paths in step #3 were incorrect. Thanks to Tokuriku!!

UPDATE In Xcode 7 and 8, click File>New>Target... and there select "Other" group to select Aggregate target

iOS Architecture | iOS Tutorial, ios8 Xcode 6 iOS Creating a Cocoa Touch Framework Architectures issues? Create a new (Aggregate) target in your framework's project. Under "Build Phases"  Xcode 6 iOS Creating a Cocoa Touch Framework-Architectures issues (6) . 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.


Including Frameworks, Under iOS, select Framework & Library and choose Cocoa Touch Framework click “Next” Or if the project is build in “Device”, it would generate architectures which would let the BUILD_ROOT="${BUILD_ROOT}" clean buildxcodebuild -​target "${PROJECT_DIR}"# Step 6. But still there is a problem. It’s now time for a second target — of type Cocoa Touch, for iOS (ensure you select iOS tab above) As discussed, give it a unique name, e.g. append “Touch” to indicate that it’s for iOS


Creating your own & simple Framework in iOS, was developed based on model view controller software architecture. Cocoa Touch. The frameworks in this layer directly support applications based in iOS. They include frameworks such as Game Kit, Map Kit, and iAd. The Cocoa Touch layer and the Core Services layer each has an Objective-C framework that is especially important for developing applications for iOS. These are the core Cocoa frameworks in iOS: UIKit.


works as an intermediary between the underlying hardware and the apps you make. Apps do not communicate to the underlying hardware directly. Apps talk with the hardware through a collection of well defined system interfaces. The first thing to know about is the difference between a Cocoa Touch Static Library (aka static library) and a Cocoa Touch Framework (aka framework). From a practical perspective, frameworks are only supported from iOS 8 onwards, whereas static libraries go “all the way back” to iOS 6, which is as far back as you can build an Xcode project


I've changed someone's script a bit to support all Simulator's architectures:

UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal

# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"

# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator VALID_ARCHS="x86_64 i386" BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build

# Step 2. Copy the framework structure to the universal folder
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"

# Step 3. Create universal binary file using lipo and place the combined executable in the copied framework directory
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}"

# Step 4. Convenience step to copy the framework to the project's directory
cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"

# Step 5. Delete temporary build directory in the project's directory
rm -rf "${PROJECT_DIR}/build"

# Step 6. Convenience step to open the project's directory in Finder
open "${PROJECT_DIR}"

Embedding a Framework in iOS, macOS, watchOS, and tvOS Apps Create a new Xcode target and select the framework template appropriate ERROR ITMS​-90203: Invalid architecture: Apps that include an app Figure 6 Framework reference in the Project Navigator that is not in the Products section  GitHub Gist: star and fork lzyy's gists by creating an account on GitHub.


In this tutorial, you'll learn how to build an iOS framework so you can share code In Xcode 6, Apple introduced the Cocoa Touch Framework template along You'll link the framework to the app's target to fix this problem. Under iOS, select Framework & Library and choose Cocoa Touch Framework click “Next” Image : Choosing Template for New Project Enter your framework name and click “Next” .


Xcode 6 iOS Creating a Cocoa Touch Framework - Architectures issues. Question. I'm trying to make a dynamic framework for an iOS app. Thanks to the new  Script to create a universal or "fat" binary for an iOS framework. - create-fat-framework.sh


With iOS 8, Apple introduced a number of app extensions such as the Share Fat frameworks contain compiled code for multiple architectures. Project and select iOS > Framework & Library > Cocoa Touch Framework: part of the same project, this isn't a problem; Xcode will build the framework and the  Xcode Server supports the new Xcode performance-testing features, making it easy for a team to share a Mac computer and a group of iOS devices for continual performance testing. Delta tracking. Issues are now tracked per integration, so you can see when an issue appeared or when it or was fixed, and by whom.