gpt4 book ai didi

ios - 找不到目标 'MyCustomFramework' 的模块 'x86_64-apple-ios-simulator' ;找到 : arm64, armv7-apple-ios,arm64-apple-ios,arm,armv7

转载 作者:行者123 更新时间:2023-12-01 15:23:05 30 4
gpt4 key购买 nike

我有一个自定义框架,我正在归档以在另一个项目中使用。更新到 Xcode11 后,我在使用该框架的项目中收到以下错误。
找不到目标“x86_64-apple-ios-simulator”的模块“MyCustomFramework”;找到:arm64、armv7-apple-ios、arm64-apple-ios、arm、armv7
我的框架在 Xcode10 上运行良好,但在 11 上不行。我的目标设置为 NO,仅用于构建事件架构。我有以下有效架构; arm64e、armv7s、armv7、arm64。
我的构建脚本

exec > ${PROJECT_DIR}/${PROJECT_NAME}_archive.log 2>&1

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

if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"

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

echo "Building for iPhoneSimulator"
xcodebuild -workspace "${WORKSPACE_PATH}" -scheme "${TARGET_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 11 Pro Max' ONLY_ACTIVE_ARCH=NO ARCHS='i386 x86_64' BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" ENABLE_BITCODE=YES OTHER_CFLAGS="-fembed-bitcode" BITCODE_GENERATION_MODE=bitcode clean build

# Step 1. Copy the framework structure (from iphoneos build) to the universal folder
echo "Copying to output folder"
cp -R "${ARCHIVE_PRODUCTS_PATH}${INSTALL_PATH}" "${UNIVERSAL_OUTPUTFOLDER}/"

# Step 2. Copy Swift modules from iphonesimulator build (if it exists) to the copied framework directory
SIMULATOR_SWIFT_MODULES_DIR="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${TARGET_NAME}.framework/Modules/${TARGET_NAME}.swiftmodule/."
if [ -d "${SIMULATOR_SWIFT_MODULES_DIR}" ]; then
cp -R "${SIMULATOR_SWIFT_MODULES_DIR}" "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Modules/${TARGET_NAME}.swiftmodule"
fi

# Step 3. Create universal binary file using lipo and place the combined executable in the copied framework directory
echo "Combining executables"
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${EXECUTABLE_PATH}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${EXECUTABLE_PATH}" "${ARCHIVE_PRODUCTS_PATH}${INSTALL_PATH}/${EXECUTABLE_PATH}"

# Step 4. Create universal binaries for embedded frameworks
#for SUB_FRAMEWORK in $( ls "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Frameworks" ); do
#BINARY_NAME="${SUB_FRAMEWORK%.*}"
#lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Frameworks/${SUB_FRAMEWORK}/${BINARY_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${SUB_FRAMEWORK}/${BINARY_NAME}" "${ARCHIVE_PRODUCTS_PATH}${INSTALL_PATH}/${TARGET_NAME}.framework/Frameworks/${SUB_FRAMEWORK}/${BINARY_NAME}"
#done

# Step 5. Convenience step to copy the framework to the project's directory
ARCHIVE_PATH="${PROJECT_DIR}/Products"
rm -rf "${ARCHIVE_PATH}"
mkdir "${ARCHIVE_PATH}"

echo "Copying to project dir"
yes | cp -Rf "${UNIVERSAL_OUTPUTFOLDER}/${FULL_PRODUCT_NAME}" "${ARCHIVE_PATH}"

open "${ARCHIVE_PATH}"

fi

最佳答案

此行不正确

cp -R "${SIMULATOR_SWIFT_MODULES_DIR}" "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Modules/${TARGET_NAME}.swiftmodule"

应该
cp -R "${SIMULATOR_SWIFT_MODULES_DIR}" "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Modules/"

您需要 checkin 目标文件夹
"${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Modules/"

如果有类似的文件
x86_64-apple-ios-simulator.swiftdoc
x86_64-apple-ios-simulator.swiftmodule
x86_64.swiftdoc
x86_64.swiftmodule

在 Xcode 11 之前,Apple 似乎忽略了这些文件,因此您的脚本运行良好。

从 Xcode 11 开始,这些文件似乎经过严格检查。

关于ios - 找不到目标 'MyCustomFramework' 的模块 'x86_64-apple-ios-simulator' ;找到 : arm64, armv7-apple-ios,arm64-apple-ios,arm,armv7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58086787/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com