[Bug] Using PHPickerViewContrller cannot get any data

Step 1: Remove all photos in Album.
Step 2: Sync some iCloud photos, NOT download original photos.
Step 3: Then the demo below cannot get any data with error.

Even if i create some photos after meet the bug (such as taking photo and downloading images), i still cannot get any data from delegate method.

This is the error log:👇

2020-07-08 15:26:46.884818+0800 NewsInHouse[1523:58692] [claims] Upload preparation for claim 73945DAC-B563-4954-A0F9-E98BC430ADF7 completed with error: Error Domain=NSCocoaErrorDomain Code=260 "未能打开文件“F7BC94F4-157E-46B9-AEAB-32224F254171.png”,因为它不存在。" UserInfo={NSURL=file:///private/var/mobile/Containers/Shared/AppGroup/B5732C05-0CBA-4A8D-B405-CCBF0F058C2A/File%20Provider%20Storage/F7BC94F4-157E-46B9-AEAB-32224F254171.png, NSFilePath=/private/var/mobile/Containers/Shared/AppGroup/B5732C05-0CBA-4A8D-B405-CCBF0F058C2A/File Provider Storage/F7BC94F4-157E-46B9-AEAB-32224F254171.png, NSUnderlyingError=0x28059ce10 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}



Code Block Objective-C
- (void)picker:(PHPickerViewController *)picker didFinishPicking:(NSArray<PHPickerResult *> *)results API_AVAILABLE(ios(14)){
  [picker dismissViewControllerAnimated:YES completion:nil];
  dispatch_group_t getPhotoGroup = dispatch_group_create();
  block NSMutableArray *imagesArray = [NSMutableArray array];
   
  for (PHPickerResult *result in results) {
    NSItemProvider *provider = result.itemProvider;
    dispatch_group_enter(getPhotoGroup);
    if ([provider canLoadObjectOfClass:UIImage.class]) {
      [provider loadObjectOfClass:UIImage.class completionHandler:^(kindof id<NSItemProviderReading> _Nullable object, NSError * _Nullable error) {
        if ([object isKindOfClass:UIImage.class]) {
          NSLog(@"uiimage get..");
          [imagesArray addObject:asset];
          dispatch_group_leave(getPhotoGroup);
        } else {
          NSLog(@"uiimage none..");
        }
      }];
    }
  }
   dispatch_group_notify(getPhotoGroup, dispatch_get_main_queue(), ^{
...
  });
}





Answered by Engineer in 619916022
Thanks for asking! We are aware of this issue (64630315) and it will be fixed in a future release.
Accepted Answer
Thanks for asking! We are aware of this issue (64630315) and it will be fixed in a future release.
[Bug] Using PHPickerViewContrller cannot get any data
 
 
Q