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

QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) isn't writable in Android 10

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.15.0 RC
    • Core: I/O
    • Qt 15.5.0-RC + SDK Version: 26.1.1, NDK Bundle Version: 21.1.6352462 + buildToolsVersion '29.0.3' + targetSdkVersion = 29
    • Android

    Description

      Android 10 introduced Scoped Storage and, unless AndroidManifest.xml declares android:requestLegacyExternalStorage="true", QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) is no longer writable. Writing in such a location fails with a 'device no open' error.

      qstandardpaths_android.cpp uses Android's Environment.getExternalStoragePublicDirectory(), which is deprecated in API level 29. It should probably be changed to Context.getExternalFilesDir() and, optionally, handle the URI permissions to make it available for other applications if it's the case.

      I can try a patch if you give me some directions on where to point those locations to.

      Attachments

        Issue Links

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

          Activity

            People

              assam Assam Boudjelthia
              sandroandrade Sandro S. Andrade
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes