Crash on Xcode 8.0 GM iPhone Simulator (iOS 10)
Asked Answered
P

3

13

When I run my project on real device , everything works fine.

But when I try to run it on the simulators(iOS 10,iPhone 7 && iPhone 6) ,the app crashed and no debugger messages in the Debugger Output.

The crashed Thread look like this

enter image description here

I want to know what the

TCC`CRASHING_DUE_TO_PRIVACY_VIOLATION

means , and how to fix the problem?

Precinct answered 8/9, 2016 at 7:20 Comment(4)
What code/controller is causing crash? Try to debug your project using break point or logs.Stickybeak
It looks like the app was killed by system, I have already add All Exceptions breakPoint , but no lucky.Precinct
If your app is crashed due to XPCConnection then you need to use stable OS version only. its possible with beta software. Because its due to internal hardware communication.Stickybeak
For me it happened in a device with iOS 10~ but not in another device with 9~Limitless
I
30

Are you using a feature that requires user approval (like Camera, Location, etc)? TCC handles access to such resources and a crash in __CRASHING_DUE_TO_PRIVACY_VIOLATION__ usually means you aren't fulfilling the requirements to use that feature.

Make sure you have the usage description key for any of those features in your Info.plist file. iOS 10 now absolutely requires you supply descriptions such as:

<key>NSCameraUsageDescription</key>
<string>For taking selfies!</string>

It is probably working on your device because you previously granted permission. If you delete the app and wait 24 hours (or install on a different device that has never had the app installed before) you'd probably see the same thing on device. (Different services have different policies for whether permission disappears quickly or is saved for a while to allow for reinstalls).

Update:

There is a nice Technical Q&A page on developer.apple.com that describes the frameworks that require a usage description and lists the relevant key(s) for each framework and the class/function/selector(s) involved.

Inutility answered 9/9, 2016 at 17:28 Comment(4)
Does anybody know how to list these in a Cordova project?Rhinehart
@Birowsky #39572103Cheatham
@Cheatham yeah that's me :}Rhinehart
oops i didnt notice that :)Cheatham
H
3

In addition to @russbishop's answer:

You need to do the same thing for accessing gallery as well. Something like:

<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to use your photo library</string>

PS: Totally opposite to your case, I was getting this same crash on device but not on simulator.

Hokku answered 20/10, 2016 at 9:46 Comment(0)
M
2

In addition to all above answers:

For me it was the camera and microphone, NSCameraUsageDescription and NSMicrophoneUsageDescription.

If you want to record video you should add both of them.

Thanx Apple.

Montgomery answered 24/11, 2016 at 11:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.