compose-multiplatform
compose-multiplatform copied to clipboard
ImageViewer example: Android application crash due to missing Android Manifest FileProvider
Describe the bug ImageViewer android application crash due to missing Android Manifest FileProvider
Affected platforms
- Android application
Versions Libraries:
- Compose Multiplatform version: LAST
- Kotlin version: 1.9.23
- OS architecture (x86 or arm64): arm64
- Device (model or simulator for iOS issues): simulator
- JDK (for desktop issues): 17
To Reproduce Steps to reproduce the behavior:
- Start android application on emulator
- Click on some image
- Click again on selected image (Top) to view details
- Scroll down to show share button
- click on Share button
Expected behavior Share dialog open
current behavior Application crash
it seem that ImageViewerFileProvider is not merged in manifest project !!!
even if the code seem correct in shared grade build file
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
Hello, @issamux!
Thanks for highlighting this.
We forgot to add
I reviewed your PR, and it seems like it doesn't fix that issue in its current state. But adding this should fix it:
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
right after android:grantUriPermissions="true"> in the shared/src/androidMain/AndroidManifest.xml
Thus, if you want to fix it yourself, please, consider my suggestion. We would be glad for your contribution here.
@mazunin-v-jb thanks for your comment, PR updated.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.