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就不行。这是为什么?

你可能感兴趣的:(#,App开发,ARCHS,unboundvariable)