ERROR “swiftc failed with exit code 1” when converting to latest syntax

前端 未结 26 2094
傲寒
傲寒 2020-12-14 05:31

I was trying to convert syntax of old Swift project to new one as per few suggestion on Stack Overflow I tried converting it through Edit > Convert > To latest Synta

相关标签:
26条回答
  • 2020-12-14 06:05

    Just remove inactive file(deleted file) from Build phases

    then

    Clean Xcode. (cmd+shift+k)

    0 讨论(0)
  • 2020-12-14 06:07

    Just had the same issue. For me it was because I had renamed some of the project directories. I had a ton of red files in my project navigator. To solve, follow these steps:

    1. click on the directory in project navigator where many files show as red
    2. Under "Identity and Type" in the File Inspector (on the right side), click Containing directory
    3. Select the new directories
    4. Rebuild - command shift K, command B
    0 讨论(0)
  • 2020-12-14 06:07

    In my case I deleted few files from project and when try to commit the code, the files was showing there . To solve this issue. 1. Open terminal 2. Type git clean -n // it will show you list of files which are deleted from project but still are saved somewhere 3. Type git clean -f // All unwanted files will be removed

    0 讨论(0)
  • 2020-12-14 06:07

    I had this error when Xcode found two .swift files with same name. Rename one of them and build again.

    0 讨论(0)
  • 2020-12-14 06:08

    In my case I copied a core data entity and only renamed the entity but not the class. So go to your xcdatamodel and select the enitity > rename also the class name

    0 讨论(0)
  • 2020-12-14 06:10

    In my case swift development snapshot was selected instead of xcode 9.2. here are the steps and image.

    1. xcode on screen and click on xcode top menu bar.
    2. Than go to toolchains option and check on xcode 9.2. thats it.

    Note: If no toolchain found in your xcode than download from Here and install it. (after installation restart xcode). Happy Coding!!!

    0 讨论(0)
提交回复
热议问题