我正试图通过fastlane将我们的应用程序发布到testflight / appstore,我得到了这两个错误:
致命错误:当指定-remove选项时,输入文件(== FILEPATH == / CommonCrypto.framework / CommonCrypto)必须是胖文件
致命错误:lipo:无法打开输入文件:== FILEPATH == / Frameworks / CommonCrypto.framework / CommonCrypto(没有这样的文件或目录)
在我收到这些错误之前,我得到了很多“不支持的架构”错误。
ERROR ITMS-90087:“不支持的体系结构。== APPNAME ==。app / Frameworks / == FRAMEWORK_NAME ==。框架的可执行文件包含不受支持 架构'[x86_64,i386]'。“
ERROR ITMS-90087:“不支持的体系结构。== APPNAME ==。app / Frameworks / CommonCrypto.framework的可执行文件包含不受支持 架构'[x86_64]'。“
所以我将此脚本添加到构建阶段:(From another stack overflow post)
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done
commoncrypto 框架是在嵌入式二进制文件中手动添加的,因为它只能通过Carthage使用。但该项目主要使用cocoapods。
我想删除脚本会解决它。但后来回到了原来的问题。
但感谢所有帮助!