Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-27134

Unable to enable useAndroidX ad to use FileProvider

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • Qt Creator 6.0.2
    • Android Support
    • Android

      The latest android api levels require FileProvider implementation to create and share files.
      So the tutorial
      https://developer.android.com/reference/androidx/core/content/FileProvider
      does not work in Qt world because, after having added the section

       

      <provider
              android:name="androidx.core.content.FileProvider"
              android:authorities="org.qtproject.example"
              android:exported="false"
              android:grantUriPermissions="true">
              <meta-data
                     android:name="android.support.FILE_PROVIDER_PATHS"
                     android:resource="@xml/file_paths" />
      
          </provider>
      

       

      {{}}

      after having added the file file_path.xml and
      android.useAndroidX=true
      android.enableJetifier=true
      in the gradle.properties, during statup the application goes to crash with

       

      E AndroidRuntime: FATAL EXCEPTION: main
      E AndroidRuntime: Process: org.qtproject.example, PID: 2905
      E AndroidRuntime: java.lang.RuntimeException: Unable to get provider androidx.core.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "androidx.core.content.FileProvider" on path: DexPathList[[zip file "/data/app/org.qtproject.example-KFKpcJodUkUxx65aKHw76A==/base.apk"],nativeLibraryDirectories=[/data/app/org.qtproject.example-KFKpcJodUkUxx65aKHw76A==/lib/arm, /data/app/org.qtproject.example-KFKpcJodUkUxx65aKHw76A==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
      E AndroidRuntime: 	at android.app.ActivityThread.installProvider(ActivityThread.java:6242)
      E AndroidRuntime: 	at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805)
      E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722)
      E AndroidRuntime: 	at android.app.ActivityThread.-wrap1(Unknown Source:0)
      

       

       

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

            portale Alessandro Portale
            mrdebug Denis Gottardello
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes