Xcode Preview is not working. Successed to build Preview but error message displays like below:
I think it's maybe related with loader path followed by error details below. I created xcproj file using tuist 4.19.0. How can I fix this issue?
Xcode Preview is not working. Successed to build Preview but error message displays like below:
I think it's maybe related with loader path followed by error details below. I created xcproj file using tuist 4.19.0. How can I fix this issue?
So sorry you're running into this. And thank you so much for sharing these diagnostic details. From what we can tell this looks familiar and we're pretty sure this was resolved in the latest Xcode 16.1 beta. Can you download that and give it a try? Let us know if it works or not for you.
I am experiencing the same issue on Xcode 16.1 (16B40), when merged binary is enabled, erroring (redacted my library name with <<X>>
):
| ==================================
|
| | CouldNotParseInput
| |
| | ==================================
| |
| | | FailedParsingMachObjectFile
| | |
| | | MachO data could not be parsed for: <<X>>
| | | Reason: Underlying failure reading data
| | | Data header bytes: []
| | | Data header ASCII: "<nil>"
| | |
| | | ==================================
| | |
| | | | NSError.NSCocoaErrorDomain.260: The file “<<X>>” couldn’t be opened because there is no such file.
| | | |
| | | | NSCocoaErrorDomain (260):
| | | | ==NSURL: <<X>> -- file:///
| | | | ==NSFilePath: /<<X>>
| | | |
| | | | ==================================
| | | |
| | | | | NSError
| | | | |
| | | | | NSError: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"
Also experienced this on Xcode 16.2
“TelementryProvider+Widget.o” couldn’t be opened because there is no such file.
.
Hmm. Can you verify if the file is there or not? Does the issue keep happening if you do a clean build first?
Oh, the full file path it was looking for is: /Users/myuser/appdev/Xcode/DerivedData/MyApp-csfdrvwkesfmfoeoixavlyxskids/Build/Intermediates.noindex/MyApp.build/MyApp-Debug-iphonesimulator/MyAppWidgetsExtension.build/Objects-normal/arm64/TelementryProvider+Widget.o
currently experiencing this also on Xcode 16.2; one of my static .a libraries could not be found according to the error. Works when run. This is a macos app btw.
Can you try the Xcode 16.3 beta? We want to see if that improves things. We've also added more logging to the Previews diagnostics to help us triage things. The more details we get the better. Some of the issues come down to project specific configurations that are hard to diagnose from just the error message.
Steps to generate helpful diagnostics:
previews-diagnostics-0123456789.zip
)Tried using Xcode 16.3, same error. I followed your steps and submitted a feedback report with id FB16960598
Same problem here, also Xcode 16.3. Submitted FB17171736.
Included the Preview Diagnostics, as per description above.
Having the same problem in Xcode 16.3, but I'm pretty sure I've figured out the problem.
If there are any relative paths in your linker flags, make sure they start with $(SRCROOT)/ I'm betting that the linker, as being run in Preview, does not have the same current directory as when running for building. Any relative paths will be rooted from that other spot and files will not be found.
So if you've got any of these: "/..", be sure to prefix them with "$(SRCROOT)/"
Aha! Thank you so much for pointing this out. We'll investigate what's going on about this.