Android 11, image picker doesn't have a selection after picking an image (from external storage)

Đang mở
#551 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
android, typescript
Lĩnh vực
mobile

Hướng nghiên cứu

Bắt đầu từ điểm truy cập pickImage và lệnh gọi imagePicker.present() của nó, tái hiện việc lựa chọn trống trên Android 11 khi chọn một hình ảnh từ bộ nhớ ngoài. So sánh trường hợp này với bộ nhớ trong và các cấu hình quyền được liệt kê trên image picker 2.0.2 và 3.0.0. Được xem là hoàn tất khi việc chọn một hình ảnh bên ngoài tạo ra một lựa chọn có dữ liệu như trên các thiết bị và vị trí lưu trữ khác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

The following error only seems to happen on Android 11. After imagepicker.present() and selecting an image from external storage the selection is empty. When picking an image from internal storage everything works as expected.

Setup and code:
I have tried with the following confuriations:
Image picker 2.0.2, and 3.0.0

/// 1
android.permission.READ_EXTERNAL_STORAGE
android.permission.MANAGE_EXTERNAL_STORAGE (and manually giving the app /// full permission) "

requestLegacyExternalStorage="true"
///

//// 2
android.permission.READ_EXTERNAL_STORAGE
requestLegacyExternalStorage="true"
////

/// 3
android.permission.READ_MEDIA_IMAGES
android.permission.READ_MEDIA_VIDEO
///

And
public pickImage(options?: OptionsCommon, hostView?: View): Promise {
// Create image picker
const p = imagePicker.create({
mode: 'single',
maximumNumberOfSelection: 1,
mediaType: ImagePickerMediaType.Image,
}, hostView); // Hostview is important to render on top of a modal

// Authorization is required (allow app to ...)
return p.authorize()
  .then(() => p.present()) // Present the imagepicker
  .then((selection) => {
    console.log(selection);
    const imagePickerSelection = selection[0];
    return Promise.all([Promise.resolve(imagePickerSelection.asset), isIOS ?
      ImageSource.fromAsset(imagePickerSelection.asset) : null]);
  })
  .then((f: [ImageAsset, ImageSource]) => this.processPickedImage(f, options))
  .catch(reason => Promise.reject(this.processPickingFailure(reason)));

}

on any other device then android 11, or when selecting from internal storage the console.log() prints the selection as expected.
When picking from external storage, and only on android 11 there is no selection.

Ngôn ngữ chính
TypeScript
Star
206
Fork
123
Merge trung bình
2 ngày 1 giờ
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NativeScript/plugins

Tất cả issue của NativeScript/plugins

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.