iOS提审报错Asset validation failed(90087),Asset validation failed (90125)

问题:iOS提审时被苹果打回,打回原因如下:

Asset validation failed (90125)
The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker. 

Asset validation failed (90087)
Unsupported Architectures. The executable for gctxtw.app/Frameworks/AdjustSigComHotgamecenterZlsgSdk.framework contains unsupported architectures '[x86_64, i386]'. 
Asset validation failed (90125)
The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker. 

报错原因可以看到是因为AdjustSigComHotgamecenterZlsgSdk.framework这个三方库文件包含了x86_64,i386这两个框架;

解决方法:

方案一:

1、先查看.framework这个三方库文件包含的框架;

lipo -info xxxxxx..framework/xxxxxx

Architectures in the fat file: XXXX.framework/XXXX are: x86_64 armv7 arm64

2、剔除掉x86_64和i386这两个框架,只保留armv7和arm64。

lipo xxxxxx.framework/xxxxxx -thin armv7 -output xxxxxx_armv7
lipo xxxxxx.framework/xxxxxx -thin arm64 -output xxxxxx_arm64
lipo -create xxxxxx_armv7 xxxxxx_arm64 -output xxxxxx
mv xxxxxx xxxxxx.framework/

3、再重复第一步,确认一下包含的框架,直到不包含x86_64,i386这两个框架就可以了;

方案二:

是在TARGETS->Build Phases->点击加号选择New Run Script Phase,然后复制粘贴下面代码。

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

我这里是只用了方案一重新打包上传就成功了。

你可能感兴趣的:(ios)