-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
Qt Creator 6.0.2
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)