Fix 'App Has Crashed' Error: Adding NSSpeechRecognitionUsageDescription to Info.plist
To fix the 'App Has Crashed' error because it attempted to access privacy-sensitive data without a usage description, you need to add the 'NSSpeechRecognitionUsageDescription' key to your app's 'Info.plist' file. This key should have a string value that describes to the user how the app uses the speech recognition data.
Follow these steps to add the key:
- Open your Xcode project and navigate to the 'Info.plist' file.
- Right-click on the 'Info.plist' file and select 'Open As' -> 'Source Code'. This will allow you to edit the file in raw XML format.
- Locate the '
' section in the file. - Add the following XML code within the '
' section:
<key>NSSpeechRecognitionUsageDescription</key>
<string>Explanation of how the app uses speech recognition data</string>
Replace 'Explanation of how the app uses speech recognition data' with a clear and concise description of how your app uses this data. For example, you could write 'This app uses speech recognition to transcribe voice commands for improved user interaction.'
- Save the 'Info.plist' file and rebuild your app.
By adding this key and description, you inform the user about why your app needs access to speech recognition data, promoting transparency and gaining user trust.
原文地址: https://www.cveoy.top/t/topic/qmZI 著作权归作者所有。请勿转载和采集!