Xcode 13 Beta Phantom Errors When Indexing

I'm seeing some weird behaviour with the Xcode 13 Betas.

My project builds with no errors. Then indexing kicks in (or at least what I think is indexing) and I'm hit with a heap of "Cannot find type 'x' in scope" errors. This is in my Swift code for bridged Objective C types.

This behaviour is new in the Xcode 13. It doesn't happen in Xcode 12.

My usual goto for this type of Xcode weirdness is cleaning the build folder and removing any derived data. However this offers only temporary respite. Once a successful build is complete and indexing occurs I'm again hit with hundreds of these seemingly phantom scope errors.

Xcode 13 Release Notes do mention the following.

Improved reliability and addressed instances where the build succeeded, but the editor showed unexpected live issues.

Radar number supplied is 71098549. No idea if this is related to what I'm seeing.

Any ideas?

This appears to be resolved in b5.

Scratch that about being resolved in b5. It's still happening.

Any ideas on how I go about debugging/logging indexing so I can file a meaningful radar?

I'm seeing this as well on the live version of Xcode 13.0 (13A233)

I have several projects that simply won't index - just goes on forever. Xcode 13 is a disaster, really. So much is broken.

Did you check Issues navigator (on the left panel). Are there any warning to update to new settings ? If so, do it.

Seems that if your project uses scripts while building to copy sources / headers, Xcode won't look into them to index because they don't exist under "Index" directory. The "Index Build" process will build project with Configuration: Null ( you can see in index build log ). So I think the solution here is that we have to re-write some rules in Build Phase and check if it is under indexing process, then modify target path. Of course, it is really disaster for me. Please, Xcode developer, fix this

Xcode 13 Beta Phantom Errors When Indexing
 
 
Q