Could not read serialized diagnostics file: Invalid File: Invalid diagnostics signature

Viewed 32745

enter image description here

I'm getting this weird warning. I'm not sure what could cause it. A .dia file extension supposedly indicates a core digraph graphics file. I did not add one and the app has almost no ui at all.

9 Answers

It appears to be an internal issue, the following steps seem to reliably resolve it for me.

  • Installing my uninstalled dependencies (ie: CocoaPods).
  • Cleaning the build folder.
  • Removing derived data.
  • Restarting Xcode
  • If that doesn't work restarting my computer makes this go away.

Here's the zsh script line I use (after navigating to the project's folder):
Note: Uses rm -rfs!

rm -rf ~/Library/Caches/CocoaPods; rm -rf Pods; rm -rf ~/Library/Developer/Xcode/DerivedData/*; pod install;

I also experienced this issue. The reason in my case was lack of storage space on my laptop so make sure to check that too.

For me this issue occurred after I updated my Xcode to iOS15. The reason behind my issue was some of my swift packages were no longer up to date. Updating all my swift packages solved this issue. To do this simply do File > Packages > Update to Latest Package Versions.

Check the file and make sure all the document is linked to the project -> Target Memembership

I'm quite sure I know the issue and it is severe if you don't use version control. It happened to me twice with working on two different projects, when my disk space was around 7GB free with Xcode 13/13.1. I could not fix it manually, only removing all and cloning the repo again made it compilable again, and freeing disk space of course.

With Xcode 12 I had this issue around 4GB free space, but I could recover at least.

If you have pods in your project then make sure you are opening the .xcworkspace and not the .xcodeproj

Solution for M1 and M2 Macbook

I'm on a 2020 M1 Apple MacBook and none of these solutions worked for me.

The folder where I had the project created in was named 'Client Works' with a space in-between even throughout folder structure.

Previously folder structure: /Users/ABC/Documents/Client Works/AwesomeProject

Change folder structure to: /Users/ABC/Documents/Client_Works/AwesomeProject

Apparently that had an adverse effect on running the pod install properly. I renamed the folder to 'Client_Works' and ran pod install and everything started working.

If you're using a third party library, it might be where this warning or error originates. In my case, I had the same error, it was from a third party library not updated for Xcode 13. I had to go to the library on Github to check if they had an update for this error, and they had. Then, I updated the library's swift package. In my case I had to use the exact commit id at which they fixed the error.

Related