问题
I am new to ios. I am building an app which requires camera access, and according to new requirements I have already added following camera permission in info.plist but still I am getting following exception. I have also tried cleaning and reinstalling app on my phone. Does any one know how to fix this.
info.plit
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
回答1:
Your privacy key value contains $(PRODUCT_NAME), which appears to be the reason that this error (only for iOS 10+) appears.
Change your privacy key value to a pure string like "Used to capture new image for photo effect" and it should correct it.
来源:https://stackoverflow.com/questions/42597172/ios-10-app-crashes-when-accessing-camera