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: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0 RC
    • Fix Version/s: 5.15
    • Component/s: Core: I/O
    • Labels:
      None
    • 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

        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:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes