macOS 10.14 mac app(Notarized) will crash when use Camera

Hello, recently i have send my mac app to be Notarized, after that every time it will crash when use camera function. I have set the needed privacys in Info.plist and Entitlements like below.

the crash logs like this:


Date/Time: 2019-12-28 02:12:01 +0000

OS Version: Mac OS X 10.14.6 (18G95)

Report Version: 104



Exception Type: SIGABRT

Exception Codes: #0 at 0x7fff69b31016

Crashed Thread: 4


Thread 4 Crashed:

0 libsystem_kernel.dylib 0x00007fff69b31016 __abort_with_payload + 10

1 libsystem_kernel.dylib 0x00007fff69b2c60d system_get_sfi_window + 0

2 TCC 0x00007fff6430f091 __TCCAccessRequest_block_invoke.93 + 0

3 TCC 0x00007fff6430efee __CRASHING_DUE_TO_PRIVACY_VIOLATION__ + 0

4 TCC 0x00007fff6430d05d __tccd_send_message_block_invoke + 231

5 libxpc.dylib 0x00007fff69c15e2f _xpc_connection_reply_callout + 36

6 libxpc.dylib 0x00007fff69c15db6 _xpc_connection_call_reply_async + 86

7 libdispatch.dylib 0x00007fff699916a7 _dispatch_client_callout3 + 8

8 libdispatch.dylib 0x00007fff699a7977 _dispatch_mach_msg_async_reply_invoke + 311

9 libdispatch.dylib 0x00007fff699a00eb _dispatch_kevent_worker_thread + 1366

10 libsystem_pthread.dylib 0x00007fff69bd161b _pthread_wqthread + 431

11 libsystem_pthread.dylib 0x00007fff69bd13fd start_wqthread + 13

12 ??? 0x0000016400001200 0x0 + 0


Have any ideas?

Replies

Accessing the camera requires two things:

You should check that you’ve actually set these correctly. It’s important that you check your built binary, not your source code (like your

.entitlements
file), because it’s not uncommon for this problem to be caused by bugs in your build process. You can do this as follows:
% codesign -d --entitlements :- MyTest.app
…
<dict>
    <key>com.apple.security.device.camera</key>
    <true/>
    <key>com.apple.security.get-task-allow</key>
    <true/>
</dict>
</plist>
% /usr/libexec/PlistBuddy -c "print NSCameraUsageDescription" MyTest.app/Contents/Info.plist
This is a dummy usage string.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

ps DTS is closed 21 Dec through 1 Jan.