11.3 crashing due to privacy violation on photo save

My apps were working fine in earlier ios11 but are now crashing in iOS 11.3 due to Privacy Violation when I try to save a photo - both on the simulator and on a real device.


I did already add the two necessary keys in the info.plist file:

  <key>NSPhotoLibraryUsageDescription</key>
  <string>This app would like to store photos you download in your photo library</string>
  <key>NSPhotoLibraryAddUsageDescription</key>
  <string>This app would like to store photos you download in your photo library</string>


Anyone else having this recently or able to tell me how to debug/fix it?

Accepted Reply

Yes - I have done Clean Build - that is not the solution. I think the problem is what I mentioned above - more specifically (in case this is useful for someone else)


The file xx-info.plist file that you see on the left and the corresponding plist that you can edit turned out NOT to be the one that the project was really using. This seems to be because the file used is (in fact) determined by the info.plist setting under Build Settings. My guess is that there may have been some corruption in xcodeproj thst allowed the two files to be different. I fixed this by removing all reference to the orignal plist file (deleting it in the side-bar and removing reference) and then adding it back with a different name (suffix xx3-info.plist) and updating the Build setting to match the new file. This seems to have cleared the problem.

Replies

Seem you need to add another key :


<key>NSCameraUsageDescription</key>

<string>Photo Library Access Warning</string>


see

h ttps://stackoverflow.com/questions/46601885/nsphotolibraryaddusagedescription-error

Thanks - yes I saw that one on S'overflow. Not sure this is my problem. Seems that the file that I could see in the xCode sidebar (and edit) was, in fact, not the one that was being used.....there was a slightly different path in Build Settings (Info.plist). This is a mess that I must have introduced when I set up multiple targets.

Did you do a clean build folder (option clean in Product menu) ?

Yes - I have done Clean Build - that is not the solution. I think the problem is what I mentioned above - more specifically (in case this is useful for someone else)


The file xx-info.plist file that you see on the left and the corresponding plist that you can edit turned out NOT to be the one that the project was really using. This seems to be because the file used is (in fact) determined by the info.plist setting under Build Settings. My guess is that there may have been some corruption in xcodeproj thst allowed the two files to be different. I fixed this by removing all reference to the orignal plist file (deleting it in the side-bar and removing reference) and then adding it back with a different name (suffix xx3-info.plist) and updating the Build setting to match the new file. This seems to have cleared the problem.

Great.


Don't forget to mark this thread as closed.