公司最近做了一个直播相关业务,其中用到了
VideoCore.Framework这个框架,然后在生成ipa上传AppStore的时候,出现了如下error信息:
解决方案
看图说话
具体步骤
Targets - Buid Phases - Run script - 下方文本框粘贴如下代码:
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
走了弯路
1.起初以为是架构问题
开始以为必须把项目中的32位全部换成64,心中一万个羊驼在奔驰好么。。。(不过据说2018年6月iOS应用必须强制剔除32位,不然就像之前那波下架一样,早做准备吧老铁们)。
2.Upload成功之后可能会报错,真机无法运行
App Installation failed, No code signature found.
后来在网上查到相关解决办法,仅供参考:
这个问题纯属偶然,打开终端,输入:
sudo chmod -R 777 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
修改文件权限,然后修改字段属性,打开:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist
修改 CODE_SIGNING_REQUIRED 字段为 YES ,保存。