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

Error opening file for writing on Android

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P1: Critical P1: Critical
    • None
    • 5.12.0
    • Core: I/O
    • None
    • Android

      I have successfully deployed files to Android into

      assets:/qml/*

      folder. Added android.permission.READ_EXTERNAL_STORAGE and android.permission.WRITE_EXTERNAL_STORAGE permissions. No problem to open file for reading there: 

       if (source.open(QIODevice::ReadOnly | QIODevice::Text)) { ... }

      However have problem for writing - construction:

      if (dest.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) { 
          ... 
      } else {
          qDebug() << destPath << ": " << dest.errorString();
      }

      returns "No such file or directory" if file does not exist (on Desktop it creates new one) and if I deploy empty file to open and rewrite it (copy source file to dest) it returns "Unknown error" and does not open the file for writing. Regression? Seems something similar was in 5.10: QTBUG-64103?

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

            taipan BogDan Vatra
            jirauser39314 user-45b5b (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes