2018-07-20 云信iOS sdk 打包编译失败解决

Xcode-Build Phases -添加Run Script.

然后在Run Script 的shell里面添加代码:


#!/bin/sh

# Strip invalid architectures

strip_invalid_archs() {

    binary="$1"

    echo "current binary ${binary}"

    # Get architectures for current file

    archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"

    stripped=""

    for arch in $archs; do

    if ! [[ "${ARCHS}" == *"$arch"* ]]; then

    if [ -f "$binary" ]; then

    # Strip non-valid architectures in-place

    lipo -remove "$arch" -output "$binary" "$binary" || exit 1

    stripped="$stripped $arch"

    fi

    fi

    done

    if [[ "$stripped" ]]; then

    echo "Stripped $binary of architectures:$stripped"

    fi

}

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"

strip_invalid_archs "$FRAMEWORK_EXECUTABLE_PATH"

done

clean 一遍,重新编译,搞定。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容