Auto-generated Intents code contains thousands of warnings in Xcode 13 beta

My project has auto-generated Swift code for Intents in my "ProjectName-Swift.h" file. In Xcode 12, this file had zero warnings, but in Xcode 13 it is filled with thousands of warnings.

About half of them are Block pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) - the other half are Multiple declarations of method 'handleIntent:completion:' found and ignored.

I have tried cleaning my project and deleting the Derived Data folder so far, but still getting the same errors.

Since these are auto-generated files, I can't go in and fix the errors myself. Has anyone else seen this on the Xcode 13 beta? Or have any idea how to fix it?

Same issue here, really annoying.

Can confirm this is still an issue on 13.2 Beta. But will work if you set Treat Warnings as Errors = No. Not ideal, but is a solution for now.

I was able to eliminate the hundreds of duplicate definition warnings by changing the Intent Class Generation Language build setting (INTENTS_CODEGEN_LANGUAGE) from Swift to Objective-C. I also had to import the auto generated intent headers into my Swift bridging header, since most of my intent usage is in Swift.

I suspect this is only an issue in projects that still use Obj-C, since all the errors only originated in Obj-C files that imported my project's Swift header, and as @CannedMango pointed out, the duplicate definitions seem to be due the new async/await functions translating to the same Obj-C method signatures as the earlier completion-based functions.

The solution reported by @GyratoryCircus (down below) worked for me too!

This is still happening in Xcode 13.2.1. i have 2 intents generating a total of 80 warnings all of the "Multiple declarations found and ignored" variety.

Can someone else on this thread confirm?

Still happening with Xcode 13.3

Still happening with Xcode 13.4

Still happening with Xcode 13.4.

I "fixed" the multiple declarations issue by doing this.

#pragma clang diagnostic push #pragma clang diagnostic ignored "-Wduplicate-method-match" #import "AppName-Swift.h" #pragma clang diagnostic pop

Same happening in Xcode 15, annoying...

Auto-generated Intents code contains thousands of warnings in Xcode 13 beta
 
 
Q