gpt4 book ai didi

ios - 不受支持的架构,.app/Frameworks/...的可执行文件包含 Flutter ios 上不受支持的架构 [x86_64]

转载 作者:行者123 更新时间:2023-12-01 16:20:32 25 4
gpt4 key购买 nike

我在构建用于测试飞行的应用程序时收到此错误消息。我使用了 Flutter 框架。 通用 IOS 设备 > 产品 > 存档

view full error message

我尝试添加此解决方案,但没有成功 I tried this solution from Daniel Kennett

我在 ios 上完全运行的脚本。

/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build

echo "Target architectures: $ARCHS"

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

echo "App Path: $APP_PATH"

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"
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")

FRAMEWORK_TMP_PATH="$FRAMEWORK_EXECUTABLE_PATH-tmp"

# remove simulator's archs if location is not simulator's directory
case "${TARGET_BUILD_DIR}" in
*"iphonesimulator")
echo "No need to remove archs"
;;
*)
if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "i386") ; then
lipo -output "$FRAMEWORK_TMP_PATH" -remove "i386" "$FRAMEWORK_EXECUTABLE_PATH"
echo "i386 architecture removed"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_TMP_PATH" "$FRAMEWORK_EXECUTABLE_PATH"
fi
if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "x86_64") ; then
lipo -output "$FRAMEWORK_TMP_PATH" -remove "x86_64" "$FRAMEWORK_EXECUTABLE_PATH"
echo "x86_64 architecture removed"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_TMP_PATH" "$FRAMEWORK_EXECUTABLE_PATH"
fi
;;
esac

echo "Completed for executable $FRAMEWORK_EXECUTABLE_PATH"
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")

done

最佳答案

我在手动将 App.framework 和 Flutter.framework 链接到 xcode 项目后遇到了同样的问题。就我而言,事实证明构建阶段的顺序是错误的:

enter image description here

将“嵌入框架”阶段移到“精简二进制”阶段之前,错误消失了。

关于ios - 不受支持的架构,.app/Frameworks/...的可执行文件包含 Flutter ios 上不受支持的架构 [x86_64],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61040901/

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