无法在 Flutter 的捆绑 NSBundle 中找到名为 'NSPhotoLibraryUsageDescription' 的故事板

Could not find a storyboard named 'NSPhotoLibraryUsageDescription' in bundle NSBundle in Flutter

我有一个实体 iPhone,我正在尝试 运行 我的 Flutter 代码。这是我得到的错误。有什么问题?

Running "flutter pub get" in flutter_app...
Launching lib/main.dart on iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 8X88B473MR
Running pod install...
Running Xcode build...
Xcode build done.                                           47.5s
Installing and launching...
(lldb) 2022-05-03 21:25:14.382722-0700 Runner[442:24659] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'NSPhotoLibraryUsageDescription' in bundle NSBundle </private/var/containers/Bundle/Application/1D4E3157-4B4B-415B-BE57-674B89A21BD4/Runner.app> (loaded)'
*** First throw call stack:
(0x1824b104c 0x19ab25f54 0x184ee2180 0x18497980c 0x1849f370c 0x184db73ac 0x184c14e44 0x184a6d62c 0x184b98b7c 0x184cb9380 0x184ef9f8c 0x184e85710 0x184a6e430 0x184b2e350 0x184a70340 0x184b5adf4 0x184fe2260 0x184a9ec60 0x184ae2524 0x184c19d70 0x184b590b4 0x193fa8e20 0x193fcecdc 0x193f896b4 0x193f8acf4 0x182123660 0x182127118 0x193f8af94 0x193f8a3d4 0x193f8e9e4 0x1824d3020 0x1824e3ce0 0x18241dfe8 0x1824237f4 0x1824373b8 0x19ddc738c 0x184dd76a8 0x184b567f4 0x1049fd554 0x104c7da24)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001b92f8964 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1b92f8964 <+8>:  b.lo   0x1b92f8984               ; <+40>
    0x1b92f8968 <+12>: pacibsp 
    0x1b92f896c <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1b92f8970 <+20>: mov    x29, sp
Target 0: (Runner) stopped.
Error launching application on iPhone.

您是否尝试在项目的 ios 文件夹中添加 info.plist

项目/ios/亚军/Info.plist

并在文件内部添加这一行

<key>NSPhotoLibraryAddUsageDescription</key>
<string>Our application needs permission to write photos...</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to photos, gallery, files and etc.. library for attachments messages </string>

如果没有尝试放这个然后尝试 运行。