# Async Await crash on iOS14 with Xcode 13.2.1

**URL:** <https://forums.swift.org/t/async-await-crash-on-ios14-with-xcode-13-2-1/54541>\
**Category:** Compiler\
**Tags:** xcode, crash, asyncawait\
**Created:** [January 10, 2022, 3:08pm UTC](https://forums.swift.org/t/async-await-crash-on-ios14-with-xcode-13-2-1/54541 "2022-01-10T15:08:11Z")\
**Posts on this page:** 1\
**Showing post:** 45

<div class="post-metadata">

**Author:** ![zavsby](https://avatars.discourse-cdn.com/v4/letter/z/848f3c/32.png) [@zavsby](https://forums.swift.org/u/zavsby)\
**Post date:** [January 14, 2022, 10:29am UTC](https://forums.swift.org/t/async-await-crash-on-ios14-with-xcode-13-2-1/54541/45 "2022-01-14T10:29:59Z")

</div>

Added such script into build scheme settings as post action script (need to select your main target in 'Provide build settings from') and now it always work without any additional magic:

```swift
FRAMEWORK_EXECUTABLE_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}/Frameworks/libswift_Concurrency.dylib"
if test -f "$FRAMEWORK_EXECUTABLE_PATH"; then
  EXTRACTED_ARCHS=()

  for ARCH in $ARCHS
  do
    echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_PATH"
    lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
    EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
  done

  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"
fi

```

Note: need to run this script only if build locally via xcode. I've just also added check if this is debug configuration (as we mostly run debug config via xcode):

```swift
if [${CONFIGURATION} = "Debug"]; then 
...
fi

```

---

_[View the full topic](https://forums.swift.org/t/async-await-crash-on-ios14-with-xcode-13-2-1/54541)._
