Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Empty list shown when device has folders containing pictures #388

Closed
ayomessenger opened this issue Nov 23, 2022 · 21 comments
Closed
Labels
await investigate The issue is waiting for further investigation. b: flutter This is a flutter issue. b: third party This is a third party package issue. i: lack of information Further information is requested. p: Android This issue only happens on Android platform. r: photo_manager Related to the photo_manager package. s: bug Something isn't working.

Comments

@ayomessenger
Copy link

Describe the bug
Asset picker shows 'Empty list' even though device has pictures in library

How to reproduce
Called with:

await AssetPicker.pickAssets(
      context,
      pickerConfig: AssetPickerConfig(
        requestType: RequestType.image,
    ),
);

permissions in AndroidManifest:

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

Steps to reproduce the behavior:

  1. Open the asset picture
  2. Empty list is dipslayed

Expected behavior
The device files containing images to be displayed.

Screenshots (If contains)
image

Version information

  • Device: Google Pixel 6
  • OS: Android 13
  • Package Version: 8.1.4
  • Flutter Version: 3.6.0

Additional context
This package used to work with 7.3.2 but now I checkout this version still this unexpected 'Empty list' behaviour occurs. I couldn't say what changed since then, Android Version? An incompatible image type?

@ayomessenger ayomessenger added the await investigate The issue is waiting for further investigation. label Nov 23, 2022
@github-actions github-actions bot added the await triage The issue is waiting for triage. label Nov 23, 2022
@AlexV525
Copy link
Member

Please verify if the example is working on your phone.

@ayomessenger
Copy link
Author

If this messages intended for me? If so, I don't understand what you want me to test

@AlexV525
Copy link
Member

Use the example of the package to test if the issue is reproducible.

@ayomessenger
Copy link
Author

Oh okay, I just tried the example and that worked. So I added the filter AssetPickerConfig with only on images, and now this works as well. I don't really understand how to be honest but it works now so thanks for your help.

@ayomessenger
Copy link
Author

It worked briefly, but after the next build the same behaviour started appearing...

I tried with the example and still get the same 'Empty List' screen.

@ayomessenger ayomessenger reopened this Nov 25, 2022
@AlexV525
Copy link
Member

Is your Pixel 6 an emulator or a real device? I can't reproduce the issue on my Android 13 device (OnePlus 9 Pro).
1553c718a2a3b354f59ad6cc8ae81ca

@ayomessenger
Copy link
Author

I'm also working with a real device with Android 13

@Danzzel
Copy link

Danzzel commented Nov 25, 2022

I have the same issue on 13 Android. Just empty screen...

@AlexV525 AlexV525 added s: bug Something isn't working. i: lack of information Further information is requested. b: third party This is a third party package issue. r: photo_manager Related to the photo_manager package. b: flutter This is a flutter issue. p: Android This issue only happens on Android platform. and removed await triage The issue is waiting for triage. labels Nov 26, 2022
@AlexV525
Copy link
Member

I've double-checked the configuration in the example and found no issues. Please help to identify the root cause by following steps:

  1. Update the cloned repo to the latest (e0951d4) and revert all local changes (if any).
  2. Run flutter clean, delete build and example/build folders, and run flutter pub upgrade for the package and the example, make sure the photo_manager is resolved as 2.5.0 in the pubspec.lock.
  3. If the issue persists, open the logcat and filter all logs related to PhotoManager and paste them into a log file, then upload them to this thread.

I'm also working with a real device with Android 13

I have the same issue on 13 Android. Just empty screen...

@ayomessenger @Danzzel Please both provide full device information and an extra screen recording when testing with the example. Thanks.

@AlexV525
Copy link
Member

Also please try to add the android.permission.READ_EXTERNAL_STORAGE permission to the manifest.

@Danzzel
Copy link

Danzzel commented Nov 26, 2022

Screenshot 2022-11-26 at 12 37 22
Screenshot 2022-11-26 at 12 37 50

https://user-images.githubusercontent.com/75837219/204085799-806f683e-ed3a-
Untitled.docx

I testing on a real device, a Google Pixel 5a
my logs in doc
Thank you for trying to help me.

@Danzzel

This comment was marked as off-topic.

@AlexV525
Copy link
Member

video_2022-11-26_13-05-55.mp4

@Danzzel Please provide full device information and an extra screen recording when testing with the example.

Also, please try to add the android.permission.READ_EXTERNAL_STORAGE permission to the manifest.

@Danzzel
Copy link

Danzzel commented Nov 26, 2022

@AlexV525 I added this permission, you can see it upper on one of my screenshots. And, of course, I can do a new record, but maybe you want to see some specific data or moments?

@AlexV525
Copy link
Member

No. Because when you're involving too many variants of configurations, it'll be hard to figure out what's wrong here.

BTW, the targetSdkVersion and compileSdkVersion matters, upgrade them to 33 if they aren't 33.

@Danzzel
Copy link

Danzzel commented Nov 26, 2022

@AlexV525 now I have compileSdkVersion = 33 and targetSdkVersion = 31. I'll try to upgrade targetSdkVersion to 33 and I will write the result with other details

@Danzzel
Copy link

Danzzel commented Nov 26, 2022

@AlexV525 Your truth, with targetSdkVersion 33 it's working.
Thanks a lot, you cool guy!)))

@ayomessenger
Copy link
Author

Just to confirm for me as well. Upgrading the targetSdkVersion to 33 also did the trick, thanks everyone :)

@AlexV525
Copy link
Member

This is now explained in the README since 434ab29.

@rlee1990
Copy link

rlee1990 commented Dec 9, 2022

@AlexV525 is there a way around setting the target device to 33? There is an issue with the camera when set to 33
Issue

@AlexV525
Copy link
Member

AlexV525 commented Dec 9, 2022

@AlexV525 is there a way around setting the target device to 33? There is an issue with the camera when set to 33

No workaround unless you use a fork camera plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
await investigate The issue is waiting for further investigation. b: flutter This is a flutter issue. b: third party This is a third party package issue. i: lack of information Further information is requested. p: Android This issue only happens on Android platform. r: photo_manager Related to the photo_manager package. s: bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

4 participants