ChatGPT解决这个技术问题 Extra ChatGPT

Xcode: Build Failed, but no error messages

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.

Possible duplicate of Xcode 4: Build Failed, No Issues

s
shim

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/0cbvw.png


I had just general issue in code with such symptoms. I guessed clang can pass error messages in code into issues tab...
really a great answer. I have build 4-5 times. even restarted the xcode
Just chiming in with a hint that might help others. I navigated to the build log via the icon shown for Xcode 12+ above. I saw that there was a search term in the filter which didn't match any of the messages, so nothing was displayed. I cleared the filter and then I got all the build log messages as I hoped.
J
Jayprakash Dubey

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.

https://i.stack.imgur.com/uvmfF.png

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

https://i.stack.imgur.com/eFzrx.png

Here you can view reasons either By Group or By Time


This is like I have my spec on my head and I am searching all over the world...
k
kris

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

https://i.stack.imgur.com/Mlo21.png

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.


l
leviathan

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.

https://i.stack.imgur.com/34aDu.png


A
Allan Scofield

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

https://i.stack.imgur.com/eS1js.png


Wow, that's cool. On my Xcode it was standard build system. I changed into new build system and the problem was solved 🤣.
File > Workspace settings
Actually, here select Show all issues, instead of "Show issues for active scheme only" and you're good. The new build system has a huge performance advantage over the old one with Swift projects.
M
Mohamed Elkassas

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


B
Burak

There might be no free disk space left.


hi and welcome to SO! note that there is already an accepted answer for this question at stackoverflow.com/a/14625517/6619250.
Mate, you saved me! This was the case with me. Thanks!!
A
AsifHabib

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.


D
Denis Kutlubaev

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:

Commit changes in Git and then discard changes in XCode if it shows "M" near files Clear derived data: Xcode -> Preferences -> location Clean build folder: Shift + Cmd + Alt + K 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.


T
Troy Carlson

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.


A
Alexander Vitanov

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


S
Seven Systems

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.


y
yoAlex5

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