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

QML Filedialog file selection crashes on Android 13

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P1: Critical
    • None
    • 6.7.0
    • None
    • Android
    • 2024wk20s2FOQtforAndroid

    Description

      The Following code snipped works fine on Windows but crashes on Android 13 after selecting a file.

       

      FileDialog
      {    
           nameFilters: ["Image files (*.png *.jpeg *.jpg *.bmp)"]   
           onAccepted: () => customBackGround.source = selectedFile  
           currentFolder: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]
      }

      Looking at the debug logs, I see:

      W ContentProvider: Error parsing userId.
      W ContentProvider: java.lang.NumberFormatException: For input string: "com.android.providers.media"
      W ContentProvider:     at java.lang.Integer.parseInt(Integer.java:797)
      W ContentProvider:     at java.lang.Integer.parseInt(Integer.java:915)
      W ContentProvider:     at android.content.ContentProvider.getUserIdFromAuthority(ContentProvider.java:2670)

       

      It seems we are hitting:

      https://android.googlesource.com/platform/frameworks/base.git/+/master/core/java/android/content/ContentProvider.java#2803

       

      The problem seems to be the returned path content://com.android.providers.media.documents/document/image%3A1000006719

      when it is assigned to a qml image.

      Attachments

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

        Activity

          People

            qtandroidteam Qt Android Team
            reg31 Regis Duflaut
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes