JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.24k stars 1.11k forks source link

ImageViewer example: Android application crash due to missing Android Manifest FileProvider #4841

Closed issamux closed 1 month ago

issamux commented 1 month ago

Describe the bug ImageViewer android application crash due to missing Android Manifest FileProvider

Affected platforms

Versions Libraries:

To Reproduce Steps to reproduce the behavior:

  1. Start android application on emulator
  2. Click on some image
  3. Click again on selected image (Top) to view details
  4. Scroll down to show share button
  5. click on Share button

Expected behavior Share dialog open

current behavior Application crash

issamux commented 1 month ago

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")

mazunin-v-jb commented 1 month ago

Hello, @issamux! Thanks for highlighting this. We forgot to add tag with fileprovider paths to the android manifest.

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.

issamux commented 1 month ago

@mazunin-v-jb thanks for your comment, PR updated.