Open rogiervandenberg opened 5 years ago
I just found out through XCode: "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."
Solution is to change the NSPhotoLibraryAddUsageDescription
value in the Info.plist into NSPhotoLibraryUsageDescription
.
That's strange, according to the docs:
NSPhotoLibraryAddUsageDescription (String - iOS) This key lets you describe the reason your app seeks write-only access to the user’s photo library. When the system prompts the user to allow access, this string is displayed as part of the alert.
NSPhotoLibraryUsageDescription (String - iOS) This key lets you describe the reason your app accesses the user’s photo library. When the system prompts the user to allow access, this string is displayed as part of the alert.
Although this keys governs read and write access to the user’s photo library, it’s best to use NSPhotoLibraryAddUsageDescription if your app needs only to add assets to the library and does not need to read any assets.
This plugin never accesses the photo library, just writes to it which is why I used NSPhotoLibraryAddUsageDescription
(this worked when I tested with iOS 11). I unfortunately do not have access to a Mac to test with anymore, so I can't test behavior on iOS 12.
I can confirm that my app crashes when I only have NSPhotoLibraryAddUsageDescription
in my Info.plist
file. Changing to NSPhotoLibraryUsageDescription
fixed the issue for me. I'm on iOS 12.2 and MacOS 10.14.4 using Android Studio.
In my case I need read access to the library as well, not just write access.
Same problem here. NSPhotoLibraryUsageDescription should not be required to add image to the gallery
When running your example on my iPhone simulator (
iPhone XS Max • 6F9DE665-62D8-4DCC-A47B-CA97DAF9BD01 • ios • iOS 12.0 (simulator)
) it crashes:Reproduce with the code example
When clicking the 'save to camera roll' button, it crashes. From within my own project I found out that it crashes on the line of
FlutterPhotokit.saveToCameraRoll
. But I cannot get any further feedback unfortunately, because of Lost connection to device. Exited (sigterm).My setup