腾讯云ImSDK.framework 上传App Store报错
2019-12-24 本文已影响0人
原味丿丿咖啡Vitas
项目加入腾讯云直播,导入ImSDK.framework,上传App Store时报错:Unsupported Architectures.ImSdk.framework contains unsupported architectures'[x86_64]'
具体错误如下图所示
错误图片.png该问题是由于 App Store 不支持 x86_64, i386 架构引起的
具体解决办法如下
1.清空编译缓存
2.清除Appstore不支持的x86_62、i386架构:
1)选择【TARGETS】>【Build Phases】
20_33_23__09_06_2019.jpg
2)单击加号,选择【New Run Script Phase】
11.png
3)添加如下代码:
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
22.png