Xcode: Build Failed, but no error messages

XcodeBuild

Xcode Problem Overview


Using Xcode 4.5.1. Our project has been building fine for the last three months, but suddenly, when I try to build, it says "Build failed", but does not show any errors on the triangle exclamation mark tab, nor does it give a reason when it pops up build failed.

We have not changed the bundle identifier, or any other project properties. I tried a clean, then build, but no luck.

What may be causing the problem?

Similar to this question, but none of the solutions apply.

Xcode Solutions


Solution 1 - Xcode

Figured it out. On the tab with three lines in a speech bubble, it shows a build log. I guess my storyboard file had become corrupt during the last git pull.

https://i.stack.imgur.com/R5boL.png"/>

For Xcode 12+ screenshot of Xcode 12 toolbar

Solution 2 - Xcode

You can see reasons for failure on Report Navigator present in Navigator window.

  • Open Navigator by pressing Hide/Show Navigator button present in top-left side of Xcode.

Screenshot 1

  • Open Report Navigator by pressing last button present on list of buttons in Navigator window.

Screenshot 2

Here you can view reasons either By Group or By Time

Solution 3 - Xcode

Click the last icon in the top bar of the left most panel in your Xcode window to reveal the secret Archive build errors.

enter image description here

It will likely be something related to code signing if you are able to build and run the app, but not Archive. Further googling of your error message should resolve that now that it has been revealed.

Solution 4 - Xcode

Click the last icon in the top bar of the left most panel in your Xcode window to reveal the "secret" Archive build errors. I had permission issues which solved for me.

Xcode - Report Navigator

Solution 5 - Xcode

If you changed the Build System to the new one, change back to the Standard. It solved for me.

Build System

Solution 6 - Xcode

Faced same issue with xCode 8 the reason was that my Apple Id session expired and xCode was not able to renew it because of network connection problems once i signed in with my Apple id in preferences. I was able to build normally again

Solution 7 - Xcode

There might be no free disk space left.

Solution 8 - Xcode

I agree with Jason. You must did something wrong. It is Xcode's bug that it could not produce the error. Just move back on your path. Open screens you edited/opened last time. In My case ; was missing in one controller.

Solution 9 - Xcode

This happened to me while I was writing in Swift 4.1 in XCode 9.3. I use RxSwift also. It never happened while I was writing in Objective C. There were no any logs in Report Navigator too. Project just compiled without errors, then failed. Couldn't figure out why.

In my case what I did and it helped:

  1. Commit changes in Git and then discard changes in XCode if it shows "M" near files
  2. Clear derived data: Xcode -> Preferences -> location
  3. Clean build folder: Shift + Cmd + Alt + K
  4. Restart XCode

After this project tried to compile and showed errors. The error was here:

do {
    let jsonData = try JSONSerialization.data(withJSONObject: timingsDict, options: .prettyPrinted)
    let decoder = JSONDecoder()
    let pTiming = try decoder.decode(PTiming.self, from: jsonData)
    observer.onNext(timing)
    observer.onCompleted()
} catch {
    print(error.localizedDescription)
    observer.onError(error)
}

I passed wrong variable name in observer.onNext(timing). It should have been pTiming.

Solution 10 - Xcode

Other answers helped me find the Report Navigator. The only error displayed was:

> Build operation failed without specifying any errors. Individual build > tasks may have failed for unknown reasons. One possible cause is if > there are too many (possibly zombie) processes; in this case, > rebooting may fix the problem.

I fixed this by closing the Simulator.

Solution 11 - Xcode

With me it was the dev provisioning profile I was using for that scheme. I changed it to release and it worked

Solution 12 - Xcode

This will also often happen if the "magical" macOS automatically restarts XCode after boot. That auto-started XCode instance will be completely broken. Quit and restart.

Solution 13 - Xcode

Try next scenario:

  • Restart Xcode
  • check that .swift file with test functions contains
import XCTest
class <name>Tests: XCTestCase {
    //...
}

*If you have Cannot find viewcontroller in scope error -> remove classes from Test Target membership

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJasonView Question on Stackoverflow
Solution 1 - XcodeJasonView Answer on Stackoverflow
Solution 2 - XcodeJayprakash DubeyView Answer on Stackoverflow
Solution 3 - XcodekrisView Answer on Stackoverflow
Solution 4 - XcodeSarathi SView Answer on Stackoverflow
Solution 5 - XcodeAllan ScofieldView Answer on Stackoverflow
Solution 6 - XcodeMohamed ElkassasView Answer on Stackoverflow
Solution 7 - XcodeBurakView Answer on Stackoverflow
Solution 8 - XcodeAsifHabibView Answer on Stackoverflow
Solution 9 - XcodeDenis KutlubaevView Answer on Stackoverflow
Solution 10 - XcodeTroy CarlsonView Answer on Stackoverflow
Solution 11 - XcodeAlexander VitanovView Answer on Stackoverflow
Solution 12 - XcodeSeven SystemsView Answer on Stackoverflow
Solution 13 - XcodeyoAlex5View Answer on Stackoverflow