I can believe fly.

Thursday, March 2, 2017

iOS应用上传AppStore出现Invalid Swift Support

【问题】
Invalid Swift Support - The bundle contains an invalid implementation of Swift. The app may have been built or signed with non-compliant or pre-release tools. Visit developer.apple.com for more information.
【解决】使用xcodebuild来编译,将丢失SwiftSupport目录。
解决的方式是:创建SwiftSupport,将swift lib库拷一份,注入Ipa包。

# Invalid Swift Support-- miss SwiftSupport
xcodepath=`xcode-select --print-path`
ipa_swift_frameworks=`find ${CONFIGURATION_BUILD_DIR}/${BUILD_PROEJCT_NAME}.app/Frameworks/ -name libswift*`
if [[ -n ${ipa_swift_frameworks} ]]; then 
    tmpDir=${CONFIGURATION_BUILD_DIR}/SwiftSupport
    [[ -d "$tmpDir" ]] || mkdir $tmpDir

    for LINE in ${ipa_swift_frameworks}
    do
      libname=`basename $LINE`
      cp "${xcodepath}/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/${sdk}/${libname}" $tmpDir
    done

    pushd ${CONFIGURATION_BUILD_DIR} && zip -r $WORKSPACE/artifacts/${MOBILE_APP_NAME}.ipa SwiftSupport
    popd
fi

参考资料:



No comments: