The solution is to add Privacy - Camera Usage Description and Privacy - Photo Library Usage Description in Info.plist.
If it is written directly in Info.plist, the prompt cannot be displayed in multiple languages. If you want multi-language prompts, you can select the Info.plist file
In InfoPlist.strings(Base) add:
/*Permission statement*/ NSPhotoLibraryUsageDescription = "Used to open photos"; NSCameraUsageDescription = "Used to open camera";
在InfoPlist.strings(Chinese(Simplified))中添加:
/*Permission statement*/ NSPhotoLibraryUsageDescription = "Used to open the album"; NSCameraUsageDescription = "Used to open the camera";
reprint address https://www.cnblogs.com/wobuyayi/p/5942793.html