提交到 App Store 问题:不支持的架构 x86 [英] Submit to App Store issues: Unsupported Architecture x86
问题描述
所以我正在尝试使用 Shopify API.当我存档应用程序并验证它时,没有问题,但是当我将它提交到应用程序商店时,它给了我以下问题.
So I am trying to use the Shopify API. When I archive the app and validate it then there are no issues but when I submit it to the app store then it gives me the following issues.
- 错误 ITMS-90087:架构不受支持.您的可执行文件包含不受支持的架构‘[x86_64, i386]’."
- 错误 ITMS-90209:段对齐无效.SJAPP.app/Frameworks/Buy.framework/Buy 中的应用二进制文件没有正确的段对齐.尝试使用最新的 Xcode 版本重建应用."(我已经在使用最新版本了.)
- 错误 ITMS-90125:二进制文件无效.LC_ENCRYPTION_INFO 加载命令中的加密信息丢失或无效,或者二进制文件已经加密.该二进制文件似乎不是使用 Apple 的链接器构建的."
- 警告 ITMS-90080:可执行有效负载/..../Buy.framework 不是位置无关的可执行文件.请确保您的构建设置已配置为创建 PIE 可执行文件."
推荐答案
问题是 Buy 框架包含针对模拟器 (x86_64) 和实际设备 (ARM) 的构建.
The problem is that the Buy framework contains a build for both the simulator (x86_64) and the actual devices (ARM).
当然,对于不受支持的架构,您不能向 App Store 提交二进制文件,因此解决方案是在提交之前手动"从最终二进制文件中删除不需要的架构.
Of course, you aren't allowed to submit to the App Store a binary for an unsupported architecture, so the solution is to "manually" remove the unneeded architectures from the final binary, before submitting it.
Daniel Kennett 提出了 一个不错的解决方案,并提供此脚本以添加到构建阶段:
Daniel Kennett came up with a nice solution and provides this script to add to the build phase:
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
我用过,效果很好.
请务必查看 Varrry 发布的修改后的脚本,因为这个脚本存在一些小问题.
make sure you look at the modified script posted by Varrry, as this one has some minor issues.
这篇关于提交到 App Store 问题:不支持的架构 x86的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!