Dmitry
Dmitry

Reputation: 733

iOS 10: sharing image/save image started crashing

I have a code which shares a line of text and an image via UIActivityViewController. After I updated to iOS 10 it started crashing with the following log:

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

I do not post the code since it seems to happen even in Apple's own example. I found a corresponding radar, but not StackOverflow topic.

Hope it will save someone's time. The fix is to add that line to your plist even though the app itself does not interact with the Photo Library. If anyone finds a better solution, it would be nice.

Please, note that it is different from a problem with UIImagePickerController - it is close to an opposite action.

Upvotes: 2

Views: 1650

Answers (1)

Dmitry
Dmitry

Reputation: 733

Add NSPhotoLibraryUsageDescription to Info.plist :-( Don't leave it empty - it reuses Apple's default question, but it is fine only for development. Uploading such archive to App Store will trigger an error.

Upvotes: 5

Related Questions