简体   繁体   English

在iPhone上运行时,应用程序崩溃,例外情况

[英]App crashes when running on iPhone with violations as exception

    Thread 1 Crashed:
0   libsystem_kernel.dylib          0x1e81a458 __abort_with_payload + 24
1  libsystem_kernel.dylib           0x1e817dd9    system_set_sfi_window + 1
2   TCC                             0x20f27c4f __CRASHING_DUE_TO_PRIVACY_VIOLATION__ + 229
3   TCC                             0x20f27b6b __CRASHING_DUE_TO_PRIVACY_VIOLATION__ + 1
4   TCC                             0x20f2a383 __tccd_send_block_invoke + 339
5   libxpc.dylib                    0x1e90215f _xpc_connection_reply_callout + 47
6   libxpc.dylib                    0x1e902101 _xpc_connection_call_reply + 27
7   libdispatch.dylib               0x1e72649b _dispatch_queue_override_invoke + 605
8   libdispatch.dylib               0x1e727a91 _dispatch_root_queue_drain + 379
9   libdispatch.dylib               0x1e7278b7 _dispatch_worker_thread3 + 107
10  libsystem_pthread.dylib         0x1e8ce937 _pthread_wqthread + 1169
11  libsystem_pthread.dylib         0x1e8ce48c start_wqthread + 8

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY 异常类型:EXC_CRASH(SIGABRT)异常代码:0x0000000000000000,0x0000000000000000异常注意:EXC_CORPSE_NOTIFY

Termination Reason: TCC, This app has crashed because it attempted to access privacy-sensitive data without a usage description. 终止原因:TCC,此应用程序已崩溃,因为它试图在没有使用说明的情况下访问隐私敏感数据。 The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data. 应用程序的Info.plist必须包含一个NSMicrophoneUsageDescription键,其中包含一个字符串值,向用户解释应用程序如何使用此数据。 Triggered by Thread: 1 I don't know what permissions i need to add. 由线程触发:1我不知道我需要添加什么权限。

iOS 10 onwards, when you access privacy sensitive resources like camera, microphone you should add usage description text to info.plist. 从iOS 10开始,当您访问隐私敏感资源(如摄像头,麦克风)时,您应该将用法说明文本添加到info.plist。

This text will be shown in alert asking user to grant permission to access the resource when your code tries to access the resource for the first time. 当您的代码第一次尝试访问资源时,此文本将显示在警告中,要求用户授予访问资源的权限。

So you should put appropriate message explaining why your app needs the resource :) 所以你应该把适当的消息解释为什么你的应用需要资源:)

Add key NSMicrophoneUsageDescription and a text description to info.plist and it will not crash again :) 将关键NSMicrophoneUsageDescription和文本描述添加到info.plist,它不会再崩溃:)

在此输入图像描述

Just add NSMicrophoneUsageDescription key & in value add the justification that why your app is using Microphone. 只需添加NSMicrophoneUsageDescription键并在值中添加您的应用使用麦克风的理由。 This is the latest requirement in iOS 10. 这是iOS 10中的最新要求。

只需在info plist中添加“NSMicrophoneUsageDescription”,即可从所需的麦克风访问私人数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM