Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-83372

QFileDialog::getOpenFileName always returns empty string on Android



    • Bug
    • Status: Reported
    • P2: Important
    • Resolution: Unresolved
    • 5.14.2
    • None
    • None
    • Xiaomi Mi 5, with MIUI 10.2 (Android 8.0).
    • Android


      I have working code (on Windows & Linux) that I compiled for Android: https://github.com/MayaPosch/NymphCast/tree/master/player/NymphCastPlayer

      Everything works just like on Linux and Windows, except that when I try to open a local file, I cannot get a file path back from getOpenFileName(). When this function is called, I do get the native Android (Android 8) file picker dialogue for local files, and I can select anything.

      Yet the return value is always an empty string. This happens with Qt 5.13.2 and 5.14.2, and with a somewhat older SDK & NDK (20.x), as well as the (as of writing) latest SDK & NDK (21).

      I have made sure that the AndroidManifest has the 'android.permission.WRITE_EXTERNAL_STORAGE' and 'android.permission.READ_EXTERNAL_STORAGE' permissions.

      I'm running the APK on a Xiaomi Mi 5, with MIUI 10.2 (Android 8.0).


      Since QFileDialog::getOpenFileName() clearly calls an Intent, it would make sense that it would also have provisions to get the results from said Intent. If this has been implemented, it does not appear to be working.


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            qt.team.quick.subscriptions Qt Quick and Widgets Team
            hackkitten Maya Posch
            6 Vote for this issue
            4 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes