LoginSignup
0
1

More than 3 years have passed since last update.

[Flutter] image_pickerを使ってライブラリから画像を読み込めない時の対処方法[Android 10]

Last updated at Posted at 2020-02-21

画像が読み込めない!

Flutterで写真にアクセスしようとしてimage_pickerプラグインを使用している
Android10の端末でファイルにアクセスしようとするとpermission denied
targetSdkVersionを29にしていると発生

TL;DR

対処方法のみ記載
以下リンクにあるようにAndroidManifestにおまじないを書く

<manifest ... >
  <!-- This attribute is "false" by default on apps targeting
       Android 10 or higher. -->
    <application android:requestLegacyExternalStorage="true" ... >
      ...
    </application>
</manifest>

参考リンク:
https://developer.android.com/training/data-storage/compatibility
https://developer.android.com/training/data-storage/shared/media?hl=ja#storage-permission

issue
https://github.com/flutter/flutter/issues/41459

実装などはあとで記載します。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1