ARCHS[@]: unbound variable

error

Xcode 项目编译报错 Command PhaseScriptExecution failed with a nonzero exit code

error logs:

sent 206 bytes received 20 bytes 452.00 bytes/sec total size is 759692 speedup is 3361.47 /Users/xxx/Documents/work/SVN/xxx/xxx/Pods/Target Support Files/Pods-Encompass/Pods-Encompass-frameworks.sh: line 144: ARCHS[@]: unbound variable Command PhaseScriptExecution failed with a nonzero exit code

在 /Users/xxx/Documents/work/SVN/xxx/xxx/Pods/Target Support Files/Pods-Encompass/ 这个路径下可以找到 Pods-Encompass-frameworks.sh 这个shell 脚本:

# Strip invalid architectures
strip_invalid_archs() {
  binary="$1"
  warn_missing_arch=${2:-true}
  # Get architectures for current target binary
  binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
  # Intersect them with the architectures we are building for
  intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
  # If there are no archs supported by this binary then warn the user
  if [[ -z "$intersected_archs" ]]; then
    if [[ "$warn_missing_arch" == "true" ]]; then
      echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
    fi
    STRIP_BINARY_RETVAL=0
    return
  fi
  stripped=""
  for arch in $binary_archs; do
    if ! [[ "${ARCHS}" == *"$arch"* ]]; then
      # Strip non-valid architectures in-place
      lipo -remove "$arch" -output "$binary" "$binary"
      stripped="$stripped $arch"
    fi
  done
  if [[ "$stripped" ]]; then
    echo "Stripped $binary of architectures:$stripped"
  fi
  STRIP_BINARY_RETVAL=1
}

可以看一下144行,意思是 ARCHS[@]未绑定变量,也就是说没值吧,应该是个空值,所以报错了,或者是不能识别吧。

StackOverFlow上有类似的问题,但是对我没起作用。

后来我用来新的Xcode12,编译通过了,Xcode11就不行。这是为什么?

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Morris_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值