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

前端 未结 26 2090
傲寒
傲寒 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:00

    Cleaning the project wasn't working for me, this is because I didn't pay attention to the message right above (Xcode highlights only the final command).

    In my case it was

    :0: error: filename "FileDuplicated.swift" used twice: '/../filepath/FileDuplicated.swift' and '/../filepath/FileDuplicated.swift'
    :0: note: filenames are used to distinguish private declarations with the same name
    Command /../bin/swiftc failed with exit code 1
    

    I had to change the name of one of the two files and it was solved.

    Hope this can help someone, cheers

提交回复
热议问题