Issue creating iOS "Fat Library". - ios

I have a bash script that builds my iOS static library for both ARM and i386 architectures. I am then using lipo to combine the binaries into a single "combined" library so that it can be linked to in the simulator as well as on a device. For some reason when I attempt to link against the resulting fat library I still get linker errors complaining that symbols are not found for i386 when debugging. I'm wondering if I am not building the simulator or iphoneos libraries correctly before using lipo. Can someone help me out?
Here is my bash script:
if [ $1 == "clean" ]
then
echo -e "Perform Clean\n"
if [ -d build ]
then
rm -r build
exit
fi
else
echo -e "Begin combined build process.\n"
XCODEBUILD_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin
XCODEBUILD=$XCODEBUILD_PATH/xcodebuild
echo -e "xcode build executable path: $XCODEBUILD\nBuiding i386 static library.\n"
$XCODEBUILD -project MyLibrary.xcodeproj -target "MyLibrary" -sdk "iphonesimulator" -configuration "Release" clean build
echo -e "Buiding ARM static library.\n"
$XCODEBUILD -project MyLibrary.xcodeproj -target "MyLibrary" -sdk "iphoneos" -configuration "Release" clean build
echo -e "Combine ARM and i386 libs.\nOutput: build/combined/libMyLibrary.a\n"
[ -d build/Release-combined ] || mkdir build/Release-combined
lipo -create -output "build/Release-combined/libMyLibrary.a" "build/Release-iphoneos/libMyLibrary.a" "build/Release-iphonesimulator/libMyLibrary.a"
echo -e "Done!\n"
fi
exit
When I add link against the resulting lib "build/Release-combined/libMyLibrary.a". I get linking issues. Am I doing something wrong?
Thanks!

Well there are 2 ways to make gcc/clang build a different arch.
you can pass the -m32 or -m64 flag...
but it is more explicit to use the -arch x86_64 -arch i386 flags which in apple clang and apple gcc can be passed at the same time.

Related

Fail to run 'lipo', Lib have the same architectures

I try to build static framework.
So I run following commands:
for device
xcodebuild
-project MyAppLib.xcodeproj
-sdk iphoneos
-target $PRODUCT_FRAMEWORK
-configuration Release clean build
for simulator
xcodebuild
-project MyAppLib.xcodeproj
-sdk iphonesimulator
-target $PRODUCT_FRAMEWORK
-configuration Release clean build
However when I try to run lipo:
lipo -create build/Release-iphonesimulator/MyAppLib.framework/MyAppLib
build/Release-iphoneos/MyAppLib.framework/MyAppLib
-output MyAppLib.framework
I get an error:
fatal error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo:
build/Release-iphonesimulator/MyAppLib.framework/MyAppLib and
build/Release-iphoneos/MyAppLib.framework/MyAppLib have the same
architectures (i386) and can't be in the same fat output file
From Xcode I success to build it but from CLI both have the same structure.
$ file MyAppLib.framework gives me:
MyAppLib.framework: Mach-O universal binary with 4 architectures: [i386: current ar archive] [arm_v7: current ar archive] [x86_64: current ar archive] [arm64]
MyAppLib.framework (for architecture i386): current ar archive
MyAppLib.framework (for architecture armv7): current ar archive
MyAppLib.framework (for architecture x86_64): current ar archive
MyAppLib.framework (for architecture arm64): current ar archive
If I try to run only for one platform, the build is succeeded but I get strange framework that I cannot even explore it:
Edit:
Multiplatform script:
set -e
# If we're already inside this script then die
if [ -n "$RW_MULTIPLATFORM_BUILD_IN_PROGRESS" ]; then
exit 0
fi
export RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1
RW_FRAMEWORK_NAME=${PROJECT_NAME}
RW_INPUT_STATIC_LIB="lib${PROJECT_NAME}.a"
RW_FRAMEWORK_LOCATION="${BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework"
function build_static_library {
# Will rebuild the static library as specified
# build_static_library sdk
xcrun xcodebuild -project "${PROJECT_FILE_PATH}" \
-target "${TARGET_NAME}" \
-configuration "${CONFIGURATION}" \
-sdk "${1}" \
ONLY_ACTIVE_ARCH=NO \
BUILD_DIR="${BUILD_DIR}" \
OBJROOT="${OBJROOT}" \
BUILD_ROOT="${BUILD_ROOT}" \
SYMROOT="${SYMROOT}" $ACTION
}
function make_fat_library {
# Will smash 2 static libs together
# make_fat_library in1 in2 out
xcrun lipo -create "${1}" "${2}" -output "${3}"
}
# 1 - Extract the platform (iphoneos/iphonesimulator) from the SDK name
if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]]; then
RW_SDK_PLATFORM=${BASH_REMATCH[1]}
else
echo "Could not find platform name from SDK_NAME: $SDK_NAME"
exit 1
fi
# 2 - Extract the version from the SDK
if [[ "$SDK_NAME" =~ ([0-9]+.*$) ]]; then
RW_SDK_VERSION=${BASH_REMATCH[1]}
else
echo "Could not find sdk version from SDK_NAME: $SDK_NAME"
exit 1
fi
# 3 - Determine the other platform
if [ "$RW_SDK_PLATFORM" == "iphoneos" ]; then
RW_OTHER_PLATFORM=iphonesimulator
else
RW_OTHER_PLATFORM=iphoneos
fi
# 4 - Find the build directory
if [[ "$BUILT_PRODUCTS_DIR" =~ (.*)$RW_SDK_PLATFORM$ ]]; then
RW_OTHER_BUILT_PRODUCTS_DIR="${BASH_REMATCH[1]}${RW_OTHER_PLATFORM}"
else
echo "Could not find other platform build directory."
exit 1
fi
# Build the other platform.
build_static_library "${RW_OTHER_PLATFORM}${RW_SDK_VERSION}"
# If we're currently building for iphonesimulator, then need to rebuild
# to ensure that we get both i386 and x86_64
if [ "$RW_SDK_PLATFORM" == "iphonesimulator" ]; then
build_static_library "${SDK_NAME}"
fi
# Join the 2 static libs into 1 and push into the .framework
make_fat_library "${BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}" \
"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}" \
"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}"
# Ensure that the framework is present in both platform's build directories
cp -a "${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}" \
"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework/Versions/A/${RW_FRAMEWORK_NAME}"
# Copy the framework to the user's desktop
ditto "${RW_FRAMEWORK_LOCATION}" "${HOME}/Desktop/${RW_FRAMEWORK_NAME}.framework"
Solution:
You do not have a problem. The MyAppLib.framework that appears after building your project is your static library, containing slices for all required architectures.
No need to use lipo after building your project.
Issue:
Your build script "automatically" builds your target twice, once for devices and once for simulators. Afterwards it merges both build artefacts to one fat lib (make_fat_library) using lipo.
Afterwards it copies the result around to:
#Ensure that the framework is present in both platform's build directories
As a result, you have a fat lib framework in both build directories.
Now you are trying to merge those two (already merged) fat libs. As both contain the same slices you get the error.

iOS framework missing required architecture arm64

I'm trying to create and use a framework in iOS. It was working previously and it works on the simulator but not a newer iPhone 6.
I suspect it has to do with the script, but from what I can see (I copied the script for the internet for the most part) it does have arm64 in it:
set -e
set +u
# Avoid recursively calling this script.
if [[ $SF_MASTER_SCRIPT_RUNNING ]]
then
exit 0
fi
set -u
export SF_MASTER_SCRIPT_RUNNING=1
# Constants
SF_TARGET_NAME=${PROJECT_NAME}
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# Take build target
if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]]
then
SF_SDK_PLATFORM=${BASH_REMATCH[1]}
else
echo "Could not find platform name from SDK_NAME: $SDK_NAME"
exit 1
fi
if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]]
then
echo "Please choose iPhone simulator as the build target."
exit 1
fi
IPHONE_DEVICE_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphoneos
# Build the other (non-simulator) platform
xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" -sdk iphoneos BUILD_DIR="${BUILD_DIR}" OBJROOT="${OBJROOT}" BUILD_ROOT="${BUILD_ROOT}" CONFIGURATION_BUILD_DIR="${IPHONE_DEVICE_BUILD_DIR}/arm64" SYMROOT="${SYMROOT}" ARCHS='arm64' VALID_ARCHS='arm64' $ACTION
xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" -sdk iphoneos BUILD_DIR="${BUILD_DIR}" OBJROOT="${OBJROOT}" BUILD_ROOT="${BUILD_ROOT}" CONFIGURATION_BUILD_DIR="${IPHONE_DEVICE_BUILD_DIR}/armv7" SYMROOT="${SYMROOT}" ARCHS='armv7 armv7s' VALID_ARCHS='armv7 armv7s' $ACTION
# Copy the framework structure to the universal folder (clean it first)
rm -rf "${UNIVERSAL_OUTPUTFOLDER}"
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework"
# Smash them together to combine all architectures
lipo -create "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/arm64/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/armv7/${PROJECT_NAME}.framework/${PROJECT_NAME}" -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}"
Any idea what I need to do to get this to compile for arm64 so it'll run on an iPhone 6+?
I seem to get this error:
Please choose iPhone simulator as the build target.
Command /bin/sh failed with exit code 1
Which it sounds like has to do with a script not running. Since I don't have any scripts in my test project, I went back to my framework and tried setting it to Run script only when installing and re-built my framework, but that still does not appear to be working.
You can't, unless you have the source code to the framework, and can recompile it. (That is your best solution anyway.) It's really that you are now running 64 bit code, and your framework is compiled only for 32 bit code. I did write a hack that allowed you to use previous versions of arm libraries, but I don't think that hack will survive the jump to larger bit size. You can try it if you want: click for hack.
Your script generates that error message and quits (without generating any libraries) whenever you're not building for the iOS simulator. This is the offending code:
# Take build target
if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]]
then
SF_SDK_PLATFORM=${BASH_REMATCH[1]}
else
echo "Could not find platform name from SDK_NAME: $SDK_NAME"
exit 1
fi
if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]]
then
echo "Please choose iPhone simulator as the build target."
exit 1
fi
Check your architecture and valid architecture and add $(inherited) to Other Linker Flags.

Framework using "Aggregate target" and "Cocoa Touch Framework". What is difference?

I can create Framework in XCode using "Aggregate target". Also it's possible to create "Cocoa Touch Framework" in XCode 7.
What is difference between them?
What way is preferable in new project?
I prefer to make Cocoatouch framework.
And finally, run the script to make it universal framework.
You don't need to make it to the aggregate.
FYI, here is the script I'm using now.
I found this script from the web. (I cannot remember the source)
set -e
set +u
# Avoid recursively calling this script.
if [[ $SF_MASTER_SCRIPT_RUNNING ]]
then
exit 0
fi
set -u
export SF_MASTER_SCRIPT_RUNNING=1
# Constants
SF_TARGET_NAME=${PROJECT_NAME}
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# Take build target
if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]]
then
SF_SDK_PLATFORM=${BASH_REMATCH[1]}
else
echo "Could not find platform name from SDK_NAME: $SDK_NAME"
exit 1
fi
if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]]
then
echo "Please choose iPhone simulator as the build target."
exit 0
fi
IPHONE_DEVICE_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphoneos
# Build the other (non-simulator) platform
xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" -sdk iphoneos BUILD_DIR="${BUILD_DIR}" OBJROOT="${OBJROOT}" BUILD_ROOT="${BUILD_ROOT}" CONFIGURATION_BUILD_DIR="${IPHONE_DEVICE_BUILD_DIR}/arm64" SYMROOT="${SYMROOT}" ARCHS='arm64' VALID_ARCHS='arm64' $ACTION
xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" -sdk iphoneos BUILD_DIR="${BUILD_DIR}" OBJROOT="${OBJROOT}" BUILD_ROOT="${BUILD_ROOT}" CONFIGURATION_BUILD_DIR="${IPHONE_DEVICE_BUILD_DIR}/armv7" SYMROOT="${SYMROOT}" ARCHS='armv7 armv7s' VALID_ARCHS='armv7 armv7s' $ACTION
# Copy the framework structure to the universal folder (clean it first)
rm -rf "${UNIVERSAL_OUTPUTFOLDER}"
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework"
# Smash them together to combine all architectures
lipo -create "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/arm64/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/armv7/${PROJECT_NAME}.framework/${PROJECT_NAME}" -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}"
Go to project settings -> build phases and then click the plus button to add new run script.
If you need to support iOS < 8.o then you can't use "Cocoa Touch Framework"

Build OpenLDAP client for iOS - no SASL

Since Apple is systematically deprecating OpenLDAP for iOS and OS X (some features which are needed has been removed in 10.10), my team decided to get latest OpenLDAP, build it and include libraries to application.
I need only client functionality.
Build for MacOS is not a problem:
$ ./configure --with-tls=openssl --disable-slapd \
> --prefix="`pwd`/openldap-build/common" \
> --exec-prefix="`pwd`/openldap-build/MacOS"
$ make depend
$ make
$ make install
This goes smoothly.
Problem is building for iOS. I've found nice solution which allows to build such external libraries for iOS. I tweak this bash script to go with ~openLDAP` code:
#!/bin/bash
PLATFORMPATH="/Applications/Xcode.app/Contents/Developer/Platforms"
TOOLSPATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"
export IPHONEOS_DEPLOYMENT_TARGET="8.0"
pwd=`pwd`
findLatestSDKVersion()
{
sdks=`ls $PLATFORMPATH/$1.platform/Developer/SDKs`
arr=()
for sdk in $sdks
do
arr[${#arr[#]}]=$sdk
done
# Last item will be the current SDK, since it is alpha ordered
count=${#arr[#]}
if [ $count -gt 0 ]; then
sdk=${arr[$count-1]:${#1}}
num=`expr ${#sdk}-4`
SDKVERSION=${sdk:0:$num}
else
SDKVERSION="8.0"
fi
}
buildit()
{
target=$1
hosttarget=$1
platform=$2
echo =============================================================
echo = building for target $target platform $platform ... =
echo =============================================================
if [[ $hosttarget == "x86_64" ]]; then
hostarget="i386"
elif [[ $hosttarget == "arm64" ]]; then
hosttarget="arm"
fi
export CC="$(xcrun -sdk iphoneos -find clang)"
export CPP="$CC -E"
export CFLAGS="-arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk -miphoneos-version-min=$SDKVERSION"
export AR=$(xcrun -sdk iphoneos -find ar)
export RANLIB=$(xcrun -sdk iphoneos -find ranlib)
export CPPFLAGS="-arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk -miphoneos-version-min=$SDKVERSION"
export LDFLAGS="-arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform$SDKVERSION.sdk"
mkdir -p $pwd/output/$target
./configure --disable-shared --host=$hosttarget-apple-darwin --with-tls=openssl --disable-slapd --prefix="$pwd/output-build/common" --exec-prefix="$pwd/output-build/$target"
make depend
# make clean
make
make install
echo =============================================================
echo = Success for target $target platform $platform ... =
echo =============================================================
}
findLatestSDKVersion iPhoneOS
buildit armv7 iPhoneOS
buildit armv7s iPhoneOS
buildit arm64 iPhoneOS
buildit i386 iPhoneSimulator
buildit x86_64 iPhoneSimulator
#LIPO=$(xcrun -sdk iphoneos -find lipo)
#$LIPO -create $pwd/output/armv7/lib/libpresage.a $pwd/output/armv7s/lib/libpresage.a $pwd/output/arm64/lib/libpresage.a $pwd/output/x86_64/lib/libpresage.a $pwd/output/i386/lib/libpresage.a -output libpresage.a
Configuration and make depend are Ok. make fails on each iOS target with this error:
Making all in /Users/maru/Documents/openldap-2c705e4/libraries
Entering subdirectory liblutil
cc -g -O2 -I../../include -I../../include -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -miphoneos-version-min=8.4 -c -o sasl.o sasl.c
sasl.c:26:10: fatal error: 'sasl/sasl.h' file not found
#include <sasl/sasl.h>
^
1 error generated.
make[2]: *** [sasl.o] Error 1
make[1]: *** [all-common] Error 1
make: *** [all-common] Error 1
Form what I can see SALS is not available for iOS and this is source of problems.
How I can overcome this problem? Can I configure openLDAP differently so it will use something else? Or is there a decent way to provide SASL for iOS?
I'm not familiar with iOS/OSX, but to disable Cyrus SASL you could try
--without-cyrus-sasl
in addition to your other ./configure flags, i.e. you need to run
./configure --with-tls=openssl --disable-slapd \
--without-cyrus-sasl \
--prefix="`pwd`/openldap-build/common" \
--exec-prefix="`pwd`/openldap-build/MacOS"
For further flags info check out
./configure --help
and this nice reference.

Building iOS framework missing architecture armv7s and x86_64 on fat file

I'm building my own framework by following the guide on site
Create a framework for iOS - RayWenderlich
It works well, but when I integrate the framework on test project, it catches error as "undefined symbol for architecture arm64". When I check the supported architectures by the command
<myframework>.framework xcrun lipo -info <myframework>
it misses 2 architectures armv7s and x86_64
Here is my run script on Aggregate target
set -e
# If we're already inside this script then die
if [ -n "$RW_MULTIPLATFORM_BUILD_IN_PROGRESS" ]; then
exit 0
fi
export RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1
RW_FRAMEWORK_NAME=${PROJECT_NAME}
RW_INPUT_STATIC_LIB="lib${PROJECT_NAME}.a"
RW_FRAMEWORK_LOCATION="${BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework"
function build_static_library {
# Will rebuild the static library as specified
# build_static_library sdk
xcrun xcodebuild -project "${PROJECT_FILE_PATH}" \
-target "${TARGET_NAME}" \
-configuration "${CONFIGURATION}" \
-sdk "${1}" \
ONLY_ACTIVE_ARCH=NO \
BUILD_DIR="${BUILD_DIR}" \
OBJROOT="${OBJROOT}" \
BUILD_ROOT="${BUILD_ROOT}" \
SYMROOT="${SYMROOT}" $ACTION
}
function make_fat_library {
# Will smash 2 static libs together
# make_fat_library in1 in2 out
xcrun lipo -create "${1}" "${2}" -output "${3}"
}
# 1 - Extract the platform (iphoneos/iphonesimulator) from the SDK name
if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]]; then
RW_SDK_PLATFORM=${BASH_REMATCH[1]}
else
echo "Could not find platform name from SDK_NAME: $SDK_NAME"
exit 1
fi
# 2 - Extract the version from the SDK
if [[ "$SDK_NAME" =~ ([0-9]+.*$) ]]; then
RW_SDK_VERSION=${BASH_REMATCH[1]}
else
echo "Could not find sdk version from SDK_NAME: $SDK_NAME"
exit 1
fi
# 3 - Determine the other platform
if [ "$RW_SDK_PLATFORM" == "iphoneos" ]; then
RW_OTHER_PLATFORM=iphonesimulator
else
RW_OTHER_PLATFORM=iphoneos
fi
# 4 - Find the build directory
if [[ "$BUILT_PRODUCTS_DIR" =~ (.*)$RW_SDK_PLATFORM$ ]]; then
RW_OTHER_BUILT_PRODUCTS_DIR="${BASH_REMATCH[1]}${RW_OTHER_PLATFORM}"
else
echo "Could not find other platform build directory."
exit 1
fi
# Build the other platform.
build_static_library "${RW_OTHER_PLATFORM}${RW_SDK_VERSION}"
# If we're currently building for iphonesimulator, then need to rebuild
# to ensure that we get both i386 and x86_64
if [ "$RW_SDK_PLATFORM" == "iphonesimulator" ]; then
build_static_library "${SDK_NAME}"
fi
# Join the 2 static libs into 1 and push into the .framework
make_fat_library "${BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}" \
"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}" \
"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}"
# Ensure that the framework is present in both platform's build directories
cp -a "${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}" \
"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}.framework/Versions/A/${RW_FRAMEWORK_NAME}"
# Copy the framework to the user's desktop
ditto "${RW_FRAMEWORK_LOCATION}" "${HOME}/Desktop/${RW_FRAMEWORK_NAME}.framework"
I suppose the build error when integrating framework to test project causes by the missing architecture when building framework
Solved, in my case: in the main target (RWUIControls, if you refer to Ray W. post) I added manually the armv7s architecture.
See screenshot below:
if I run the command from the terminal:
xcrun lipo -info RWUIControls
inside the framework folder now I get:
Architectures in the fat file: RWUIControls are: armv7 armv7s i386 x86_64 arm64
It's easy only change the iOS Development Target in the project Info.
In my case I had selected iOS 13 then I changed it to iOS 10 and now I have those Archs -> armv7 i386 x86_64 arm64.
These are the Architectures depending on the iOS device.
armv64: iPhoneX, iPhone 5s-8, iPad Air — iPad Pro
armv7 : iPhone3Gs-5c, iPad WIFI(4th gen)
armv6 : iPhone — iPhone3G
the above if for real devices
i386 : 32-bit simulator
x86_64 : 64-bit simulator

Resources