百度人脸识别SDK里面有一些巨坑,真机、模拟器、打包上传.ipa问题lipo: -extract x86_64 specified but fat file:
百度人脸文字识别的一些巨坑,报错的方法都没有要自己一个个找排除:
1:刚集成的时候把SDK加进去,不过还要将三个库导入到项目中后,然后在 general – embeded binaries 下添加了三个库
有可能还要在Targerts-build Phases 下创建 copy files(frameworks),再添加一次
2:由于AipBase.framewirk库里面有 i386 x86_64 armv7 arm64架构,而模拟器上是运行就是需要i386和x86_64架构的,不过打包.ipa上传时候,苹果是禁止使用i386和x86_64架构的,在打包的时候要删除掉,不然会提交报错ERROR ITMS-90087、90209、20125.。。错误,可以通过lipo终端去掉这个架构再上传(也可以通过在Targerts-build 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
加了这句之后就可以把苹果不需要的架构去掉,可以上传.ipa包,发布App Store,不过加了这之后模拟器就不能运行报错
Merging extracted architectures: x86_64想模拟器运行,先把上面Run Script删掉,上线打包再添加!(目前我就是这么解决的,欢迎广大友人提供更好的方法)
网友评论