XCode打包出现x86_64, i386 架构错误

1.相关问题描述:

      1)   IPA processing failed

SDK 带有 x86_64, i386 架构。在打发布到 AppStore 的安装包时需 要移除这两个架构(CocoaPods 方式接入会自动移除)。移除脚本可以参考:https://stackoverfl ow.com/questions/30547283/submit-to-app-store-issues-unsupported-architecture-x86

      2)上架App Store出现x86_64, i386 架构错误

 

2.解决方法

更新:最近又要上架,发现即使有了下面的脚本,但是使用xcode模拟器调试过,又报错。

解决办法:必须重新把工程编译缓存清空,操作如下:Product ->clean,按住Alt变成 clean build Folder...,等待操作完成,把自定义、第三方framework剔除掉x86_64, i386这两个架构的模拟设备缓存,再重新打包上传。

------------------------------------------------------------------------------------------------

1.**.framework,提交App Store时候报错了

2.自建或者第三方的framework里面包含了x86_64, i386 架构,当然这个AppStore是不允许的,所有会在上传的时候报错,解决办法就是要这个framework剔除掉x86_64, i386这两个架构

3.解决办法: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,Xcode)