iOS集成环信客服提示No code signature found、can't open input file、打包不成功
程序员文章站
2024-02-23 23:01:22
...
关于iOS集成环信客服打包不成功问题:
运行出现这种情况 图1
这种情况 图2
这种情况的 图3
按字面意思理解,是包里含有不支持的架构。x86_64和i386是模拟器架构,的确是在发布时不需要的。可是Framework是打好的包,如何去除是个问题
这里给出一个统一解决办法
1.全局搜索CFBundleExecutable字段,删除HelpDeskUIResource.bundle里面info.plist的的CFBundleExecutable,(解决图3的情况)
2.下面是添加删除x86_ 64功能
在shell里面写入下面代码
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
别忘了把这两个玩意选上,否则会出现图2的情况
ok了,你可以打包上传了