compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

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

Open issamux opened this issue 1 year ago • 3 comments
trafficstars

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:

  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 avatar May 20 '24 21:05 issamux

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

issamux avatar May 20 '24 21:05 issamux

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.

mazunin-v-jb avatar May 23 '24 13:05 mazunin-v-jb

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

issamux avatar May 24 '24 16:05 issamux

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Aug 26 '24 13:08 okushnikov