NativeScript / NativeScript/plugins
Android 11, image picker doesn't have a selection after picking an image (from external storage)
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 206
- フォーク
- 123
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 1
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
pickImage エントリーポイントとその imagePicker.present() 呼び出しから始め、外部ストレージから画像を選択したときに Android 11 で空の選択結果になる問題を再現します。これを、内部ストレージの場合、および image picker 2.0.2 と 3.0.0 における一覧の権限設定の場合と比較します。外部画像を選択すると、他のデバイスやストレージ場所と同様に、選択結果に値が入るようになれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, typescript
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100