You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building my electron app with electron-builder, the macOS permissions for audio capture (NSAudioCaptureUsageDescription and NSMicrophoneUsageDescription) are not being properly included in the final Info.plist file.
The issue appears to be related to how these permission strings are formatted in the generated Info.plist. They are incorrectly included with numeric indexed keys (<key>0</key>, <key>1</key>, etc.) instead of directly as top-level entries.
Reproduction
Build the app using electron-builder with the configuration from electron-builder.yml
Examine the generated Info.plist in the .app package
Notice that NSAudioCaptureUsageDescription and NSMicrophoneUsageDescription are included in a numerically indexed dictionary rather than at the root level
Current Configuration
In electron-builder.yml, we configure the permissions using extendInfo:
mac:
extendInfo:
- NSCameraUsageDescription: Application requests access to the device's camera.
- NSScreenCaptureUsageDescription: Application requires screen capture access.
- NSMicrophoneUsageDescription: Application requests access to the microphone to record your voice.
- NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder.
- NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
- NSAudioCaptureUsageDescription: Please allow access in order to capture the meeting audio.
- CFBundleURLTypes:
- CFBundleURLSchemes:
- strawberry
- CFBundleTypeRole: Editor
Expected Behavior
The permissions should be added directly to the root level of Info.plist like this:
<key>NSMicrophoneUsageDescription</key>
<string>Application requests access to the microphone to record your voice.</string>
<key>NSAudioCaptureUsageDescription</key>
<string>Please allow access in order to capture the meeting audio.</string>
Actual Behavior
The permissions are added with numeric indices as parent keys:
<key>0</key>
<dict>
<key>NSCameraUsageDescription</key>
<string>Application requests access to the device's camera.</string>
</dict>
<key>1</key>
<dict>
<key>NSScreenCaptureUsageDescription</key>
<string>Application requires screen capture access.</string>
</dict>
<!-- etc. -->
Workaround
Manually adding these permission entries directly to the Info.plist file after the build and re-code signing the app resolves the issue.
Environment
electron-builder versions tested: 26.0.1 and 25.1.8
Electron versions tested: 33.3.0 and 35 (latest)
OS: macOS
Entitlements: Appropriate entitlements for camera/microphone are in place
Additional Notes
The relevant entitlements are correctly configured in the entitlements.mac.plist file:
Description
When building my electron app with electron-builder, the macOS permissions for audio capture (
NSAudioCaptureUsageDescription
andNSMicrophoneUsageDescription
) are not being properly included in the final Info.plist file.The issue appears to be related to how these permission strings are formatted in the generated Info.plist. They are incorrectly included with numeric indexed keys (
<key>0</key>
,<key>1</key>
, etc.) instead of directly as top-level entries.Reproduction
electron-builder.yml
.app
packageNSAudioCaptureUsageDescription
andNSMicrophoneUsageDescription
are included in a numerically indexed dictionary rather than at the root levelCurrent Configuration
In
electron-builder.yml
, we configure the permissions usingextendInfo
:Expected Behavior
The permissions should be added directly to the root level of Info.plist like this:
Actual Behavior
The permissions are added with numeric indices as parent keys:
Workaround
Manually adding these permission entries directly to the Info.plist file after the build and re-code signing the app resolves the issue.
Environment
Additional Notes
The relevant entitlements are correctly configured in the entitlements.mac.plist file:
The text was updated successfully, but these errors were encountered: