解决方案:重新生成证书
https://stackoverflow.com/questions/64679302/flutter-code-signing-app-framework-failed
https://stackoverflow.com/questions/61320870/code-signing-app-framework-failed-during-distribution-of-the-app-in-app-store
解决错误的方法如下:必须将脚本添加到xcode中,该脚本将删除第3方库中未使用的代码。当您使用xcode打开flutter iOS项目时,您会在构建阶段部分看到flutter已经有一个脚本。不要弄乱这个脚本,相反,您将添加一个新脚本。这张图片是这样的: [图片上传失败...(image-4d3221-1615257061456)]
然后,您将获得以下内容:
[图片上传失败...(image-1a904c-1615257061456)]
之后,打开运行脚本并放置以下代码:
# Type a script or drag a script file from your workspace to insert its path.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_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不会处理它们,并且这种情况发生在我身上。因此,将代码复制并放置在能够处理此类字符的其他代码编辑器中(例如,Visual Studio),然后从某些行的末尾删除不需要的字符。所以现在总共有两个脚本正在运行
网友评论