添加运行脚本致命错误后构建Xcode项目的错误:lipo:输入文件 [英] Errors building Xcode Project after adding in Run Script fatal error: lipo: input file

查看:2657
本文介绍了添加运行脚本致命错误后构建Xcode项目的错误:lipo:输入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将我的应用程序上传到App Store时出现以下错误:ERROR ITMS-90087,ERROR ITMS-90209,&本问题中概述的错误ITMS-90125 提交到App Store问题:不支持的体系结构x86 并使用下面显示的脚本尝试解决问题:

I had the following errors when attempting to upload my app to the App Store ERROR ITMS-90087, ERROR ITMS-90209, & ERROR ITMS-90125 as outlined in this Question Submit to App Store issues: Unsupported Architecture x86 and used the script shown below to try and fix the problem:

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

现在我在尝试编译代码时遇到很多错误在Xcode中。

Now I'm getting a lot of errors trying to compile my code in Xcode.

Executable is /Users/[Username]/Library/Developer/Xcode/DerivedData/[AppName]-egnqksafjoylrcaxerbjrknmxdgl/Build/Products/Debug-iphoneos/[AppName].app/Frameworks/Bolts.framework/Bolts
Extracting arm64 from Bolts

fatal error: lipo: input file (/Users/[Username]/Library/Developer/Xcode/DerivedData/[AppName]-egnqksafjoylrcaxerbjrknmxdgl/Build/Products/Debug-iphoneos/[AppName].app/Frameworks/Bolts.framework/Bolts) must be a fat file when the -extract option is specified

Merging extracted architectures: arm64
fatal error: lipo: can't open input file: /Users/[Username]/Library/Developer/Xcode/DerivedData/[AppName]-egnqksafjoylrcaxerbjrknmxdgl/Build/Products/Debug-iphoneos/[AppName].app/Frameworks/Bolts.framework/Bolts-arm64 (No such file or directory)

rm: /Users/[Username]/Library/Developer/Xcode/DerivedData/[AppName]-egnqksafjoylrcaxerbjrknmxdgl/Build/Products/Debug-iphoneos/[AppName].app/Frameworks/Bolts.framework/Bolts-arm64: No such file or directory

Replacing original executable with thinned version
mv: rename /Users/[Username]/Library/Developer/Xcode/DerivedData/[AppName]-egnqksafjoylrcaxerbjrknmxdgl/Build/Products/Debug-iphoneos/[AppName].app/Frameworks/Bolts.framework/Bolts-merged to /Users/[Username]/Library/Developer/Xcode/DerivedData/[AppName]-egnqksafjoylrcaxerbjrknmxdgl/Build/Products/Debug-iphoneos/[AppName].app/Frameworks/Bolts.framework/Bolts: No such file or directory

任何想法如何解决?

推荐答案

好吧,看来Bolts框架不是一个胖二进制(即不包含多个体系结构二进制文件)因此提取和合并失败。我想最简单的解决方案是仅针对x86_64 arch的二进制文件附带的特定框架运行脚本。您可以使用'file'命令识别胖二进制文件。

Well it seems that Bolts framework is not a fat binary (i.e. Does not contain multiple architectures binaries) hence the extraction and merging fails. I guess the simplest solution will be to run the script only for specific frameworks that comes with a binary for x86_64 arch. You can identify fat binaries using the 'file' command.

这篇关于添加运行脚本致命错误后构建Xcode项目的错误:lipo:输入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆