本文介绍了在iPhone上运行时应用崩溃,并带有违规情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

    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

终止原因:TCC,此应用程序已崩溃,因为它尝试访问没有使用说明的隐私敏感数据.该应用程序的Info.plist必须包含一个NSMicrophoneUsageDescription键,该键具有一个字符串值,向用户解释该应用程序如何使用此数据.线程触发:1我不知道我需要添加什么权限.

Termination Reason: TCC, This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.Triggered by Thread: 1I don't know what permissions i need to add.

推荐答案

从iOS 10开始,访问摄像头,麦克风等对隐私敏感的资源时,应将使用情况描述文本添加到info.plist.

iOS 10 onwards, when you access privacy sensitive resources like camera, microphone you should add usage description text to 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 :)

将密钥NSMicrophoneUsageDescription和文本描述添加到info.plist,它将不会再次崩溃:)

Add key NSMicrophoneUsageDescription and a text description to info.plist and it will not crash again :)

这篇关于在iPhone上运行时应用崩溃,并带有违规情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 18:56