NSSpeechRecognitionUsageDescription not working

I have gotten an error stating, "This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSSpeechRecognitionUsageDescription key with a string value explaining to the user how the app uses this data."

But I have already added NSSpeechRecognitionUsageDescription to my info.plist and the error is still occuring. Anyone have a solution to this?

What version of xCode are you using? Did you literally try to add the key to the info.plist file? Because if you are using xCode 15, the preferred way to add the key is to enter it in the Info tab for the Target

Select the Project in the leftmost xCode pane > select the target > select the Info tab ... add it under Custom iOS Target properties using the + sign.

This, I believe is new philosophy from Apple. You may never even see the info.plist file. Since xCode 15 (4 weeks ago for me) my info.plist remains empty even when I have added custom target properties via the info tab. And things work – in particular, Speech Recognition is working. But it's working on actual iPhone and iPad devices. It is buggy in the simulator (this is documented). So don't let errors reported by the simulator inform you too much here.

@dmscro gave me the right hint. Thanks.

But it wasnt the "Custom iOS Target Properties".

My solution:

Select the Project in the leftmost xCode pane > select the target > select tab "Build Settings".

Here you set the filter to "All" and scroll down to the "Info.plist Values" section. Search for "Privacy - Speech Recognition Usage Description" and double click on the right side so that a field opens. Here you have to write your description. This worked for me. Also in the Simulator and XCode 16.

NSSpeechRecognitionUsageDescription not working
 
 
Q