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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 5.15.0 RC
    • Fix Version/s: None
    • Component/s: Core: I/O
    • Environment:
      Qt 15.5.0-RC + SDK Version: 26.1.1, NDK Bundle Version: 21.1.6352462 + buildToolsVersion '29.0.3' + targetSdkVersion = 29
    • Platform/s:
      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

              Assignee:
              assam Assam Boudjelthia
              Reporter:
              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