在IPA / Archive中检查并删除不支持的体系结构[x86_64,i386] [英] Check and Remove Unsupported Architecture [x86_64, i386] in IPA / Archive

查看:732
本文介绍了在IPA / Archive中检查并删除不支持的体系结构[x86_64,i386]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将应用程序提交到App Store时,会报告以下错误:

While submitting the app to the App Store the following error is reported:


不支持的架构。您的可执行文件包含不受支持的体系结构'[x86_64,i386]


  1. 如何解决上述错误?

  1. How can the above error be resolved ?

如何检查存档使用的体系结构或IPA?

How can I check the architectures used by the archive or IPA ?

如何确保 Release 存档不包含 x86_64 i386 (模拟器架构)。

How can I ensure that the Release archive doesn't include x86_64 and i386 (simulator architectures).


  • 是否只能通过脚本或 Build Settings 中的设置还是在哪里?

  • Is it only possible through script or is there is a setting in Build Settings or else where ?


推荐答案

如果应用程序在发布过程中包含模拟器架构,Apple已开始抱怨。

Apple has started complaining if app contains simulator architectures during distribution.

如何解决上述错误?

解决方案:

在项目目标的运行脚本中添加以下代码,这将在构建过程中从您的应用中删除模拟器架构(x86_64和i386):

Add below code in run script of Project target, this remove the simulator architecture (x86_64 and i386) from your app on building process:

外壳:

/bin/sh

代码:

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

解决方案:

那里一个解决方案,如果您只希望这样做一次。
但请注意,在执行以下步骤后,您将无法在模拟器上运行应用程序。在Testflight / App-store上部署应用程序之前就完成了。

There one more solution, if you wish to do it only once. But be careful though as after doing following steps, you will not be able to run app on simulator. Do it just before deploying the app on Testflight/App-store.

从终端进入项目的ProjectFramework.framework文件夹。运行以下命令:

Go inside the your ProjectFramework.framework folder of your project from terminal. Run following commands:

lipo -remove i386 ProjectFramework_SDK -o ProjectFramework_SDK 
lipo -remove x86_64 ProjectFramework_SDK -o ProjectFramework_SDK

从框架检查体系结构?

$ lipo -info PathToProject/ProjectName.framework/ProjectName

输出将是:
→胖文件中的架构:ProjectName是:
i386 x86_64 armv7 arm64

Output will be : → Architectures in the fat file: ProjectName are: i386 x86_64 armv7 arm64

参考。 doc:
http: //ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/

这篇关于在IPA / Archive中检查并删除不支持的体系结构[x86_64,i386]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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