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

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

    This issue is happening because of pods

    So Follow the below steps to resolve this issue

    • Remove all the pods and re-install again. Remove all the pods using below this command (rm -rf "pwd/Pods/")
    • Quit the Xcode and open it again and build the app with device (generic iOS device).
    • Now check this issue will be resolved.
    0 讨论(0)
  • 2020-12-14 06:16

    I faced this issue while using the Swift auto-generated header file in my project (named as 'TargetName'-swift.h) to use Swift classes in Objective-C.

    There was a typo in the file where I had imported this swift header. Correcting the typo helped me resolve the issue.

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

    Try below if none of the above working for you.

    My project location was desktop/my_project_folder

    I tried all above then i made simple change.

    I create one more folder on desktop past my project .

    then...

    Cause of problem in my case:

    This problem occurred when i change my project name in xcode & project folder name from desktop.

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

    For me, it was the keychainAccess problem as described in this answer (my error messages were completely opaque, all I had to go by was 'failed with exit code 1')

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

    I was working on a private pod and was also pointing to it locally. I had made some file name changes.

    Hence I was getting this error.

    All I had to do was to run pod install so it would reflect the file name changes. After that it compiled.

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

    Had the same issue but with duplicate file references. Deleting Derived Data and cleaning had no success. But I got it fixed by doing this:

    Navigate to your project.pbxproj -> open with your text editor of choice(I use atom).

    Command+F and find the duplicate file sources and then delete them.

    Build/Run and should be fixed.

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