Skip to content

[Bug report] Android getAssetListRange slow with many files #1362

@pierrexn

Description

@pierrexn

Version

3.8.3

Platforms

Android

Device Model

Samsung S20+

flutter info

[!] Flutter (Channel stable, 3.38.5, on Microsoft Windows [version 10.0.26100.7462], locale fr-FR) [337ms]
    • Flutter version 3.38.5 on channel stable at C:\flutter
    ! The flutter binary is not on your path. Consider adding C:\flutter\bin to your path.
    ! The dart binary is not on your path. Consider adding C:\flutter\bin to your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f6ff1529fd (4 weeks ago), 2025-12-11 11:50:07 -0500
    • Engine revision 1527ae0ec5
    • Dart version 3.10.4
    • DevTools version 2.51.1
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (Windows 11 or higher, 24H2, 2009) [1 887ms]

[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0-rc1) [3,6s]
    • Android SDK at C:\Users\pierre\AppData\Local\Android\sdk
    • Emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
    • Platform android-36, build-tools 36.1.0-rc1
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)

[√] Chrome - develop for the web [127ms]
[√] Visual Studio - develop Windows apps (Visual Studio Professional 2022 17.14.15 (September 2025)) [126ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Professional
    • Visual Studio Professional 2022 version 17.14.36511.14
    • Windows 10 SDK version 10.0.26100.0

[√] Connected device (4 available) [318ms]
    • SM G985F (mobile) • R58N330DJTH • android-arm64  • Android 13 (API 33)

[√] Network resources [606ms]
    • All expected network resources are available.

! Doctor found issues in 2 categories.

How to reproduce?

getAssetListRange is very slow when getting a lot of files, checkIfExists should be False in

cursor.toAssetEntity(context, throwIfNotExists = false)?.apply {

Logs

Example code (optional)

Contact

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions