This is my first structure using the Swift language and its private structure. It worked as expected until the new Xcode 9.3. After updating the new one Xcode, a problem similar to this one appeared Module compiled with Swift 4.0.3 cannot be imported in Swift 4.1.
After that, only I realized that the framework does not support updating with an automatic version (Xcode / Swift). Whether a single assembly search was detected Universal or Fat Binary Frameworkinstead of a separate assembly for the real device and simulator that I skipped earlier.
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"
BUILD_PRODUCTS="${SYMROOT}/../../../../Products"
cp -R "${BUILD_PRODUCTS}/Debug-iphonesimulator/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/." "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule"
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_PRODUCTS}/Debug-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}"
cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"
open "${PROJECT_DIR}"
fi
In Edit Schemeβ Archiveβ Post-ActionβRun Script
This time I use Swift Compiler - LanguageβSwift 3.3
And I got the expected result this time too Xcode 9.3withSwift 4.1
Xcode 9.2, ,
Module compiled with Swift 4.1 cannot be imported in Swift 3.2.3:
, . Xcode 9.2
: Swift Objective C, Min OS iOS 8.0
** **
-
compiled with newer version of Swift language (unknown ABI version 0x06) than previous files (4.0) file 'MAC location' for architecture armv7