Build fails with “Command failed with a nonzero exit code”

前端 未结 30 2437
栀梦
栀梦 2020-11-28 09:15

When I try to build my app with Xcode, an error interrupts the build process:

Command CompileStoryboard failed with a nonzero exit code

相关标签:
30条回答
  • 2020-11-28 09:46

    I encountered this error when I was upgrading my project from Swift 4 to 5. I first updated all my pods to their latest versions. When I built, some pods showed this error.

    The following steps resolved this issue for me:

    1. Removed all pods from Podfile
    2. Executed pod install to remove all installed pods
    3. Executed pod deintegrate to remove support for CocoaPods
    4. Deleted Podfile.lock and .xcworkspace from my project so no CocoaPods anymore
    5. Now my project is a pure Xcode project
    6. Opened my project from the regular .xcodeproj file
    7. Changed Swift Version of my project to Swift 5
    8. Cleaned the project (cmd+shift+K)
    9. Quitted Xcode
    10. Restored all pods to my Podfile
    11. Executed pod install to reintegrate CocoaPods and add my pods
    12. Opened the project from the .xcworkspace file
    13. Cleaned and rebuilt
    14. Some old pods that were still using Swift 4.0 (SlideMenuControllerSwift in my case) were set to Swift 5.0, caused many build errors in their code. I corrected it back to Swift 4.0 by opening the Pods project and selecting its target.
    15. Cleaned again, rebuilt.

    Now I have only errors in my own project code related with difference in Swift version I made. My job now is to fix them.

    0 讨论(0)
  • 2020-11-28 09:47

    In my case it was empty assets catalog, when I delete it everything was fine again.

    0 讨论(0)
  • 2020-11-28 09:49

    Alright, I was having the same problem with Xcode 10. I usually use a storyboard for every view, that way if someone is helping it's easier to fold code in. I needed to make one of the view on one storyboard the initial view Controller.

    0 讨论(0)
  • 2020-11-28 09:50

    This error happened to me when I forgot to change entity Properties before creating NSManagedObject subclass. Solved by:

    1. delete Entity+CoreDataClass.swift and Entity+CoreDataProperties.swift.
    2. under "class" of the entity model inspector, change "module" to Current Product Module and "codegen" to Manual/None.
    3. recreate the NSManagedObject.

    0 讨论(0)
  • 2020-11-28 09:50

    In my case, I was clean build folder then restart my mac then it's work.

    0 讨论(0)
  • 2020-11-28 09:50

    In my case it was about having a file named Location. after some digging I find out that it was about having two file with the same name (weird). Cause I don't, however, it's been solved by removing the file and adding another file with a different name.

    filenames are used to distinguish private declarations with the same name
    
    0 讨论(0)
提交回复
热议问题