Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Unable to enable useAndroidX ad to use FileProvider
Servers for Qt installer are currently down

Unable to enable useAndroidX ad to use FileProvider

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 1.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mrdebug
    wrote on 26 Feb 2022, 11:38 last edited by
    #1

    Testo di origine
    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)
    

    Have you got the same behaviour? Any idea to resolve?

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    C E 2 Replies Last reply 12 Jan 2024, 14:53
    0
    • M mrdebug
      26 Feb 2022, 11:38

      Testo di origine
      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)
      

      Have you got the same behaviour? Any idea to resolve?

      C Offline
      C Offline
      cristian-adam
      wrote on 12 Jan 2024, 14:53 last edited by
      #2

      At https://bugreports.qt.io/browse/QTBUG-106495 I hacked CMake and created a Packageing.cmake file to package a Qt application without gradle.

      I had to extract the androidx.core aar file and compile the classes.dex with the classes.jar from the aar file.

      But ... it worked! 🎉 The above error went away!

      1 Reply Last reply
      1
      • M mrdebug
        26 Feb 2022, 11:38

        Testo di origine
        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)
        

        Have you got the same behaviour? Any idea to resolve?

        E Offline
        E Offline
        ekkescorner
        Qt Champions 2016
        wrote on 13 Jan 2024, 18:09 last edited by
        #3

        @mrdebug which Qt Version are you using ?

        ekke ... Qt Champion 2016 | 2024 ... mobile business apps
        5.15 --> 6.8 https://t1p.de/ekkeChecklist
        QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

        M 1 Reply Last reply 13 Jan 2024, 19:50
        0
        • E ekkescorner
          13 Jan 2024, 18:09

          @mrdebug which Qt Version are you using ?

          M Offline
          M Offline
          mrdebug
          wrote on 13 Jan 2024, 19:50 last edited by
          #4

          @ekkescorner Sorry but it is been a long time.
          I don't remember the Qt version but I suppose the latest available version on february 2022 and Android 12 if i remember correctly.

          Need programmers to hire?
          www.labcsp.com
          www.denisgottardello.it
          GMT+1
          Skype: mrdebug

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved