Skip to content

Sharing media fails due to permission denial (Android 11) #20140

Open
@geriux

Description

@geriux

Expected behavior

Sharing media files should work in different Android versions and apps.

Actual behavior

When sharing media files to the editor, a new post, or the media library, it fails when using the File Manager app.

From the logs I can see:

Unable to start activity ComponentInfo{com.jetpack.android/org.wordpress.android.ui.ShareIntentReceiverActivity}: java.lang.SecurityException: Permission Denial: opening provider com.android.fileexplorer.provider.FileExplorerFileProvider

I've also seen other cases like:

Unable to start activity ComponentInfo{com.jetpack.android/org.wordpress.android.ui.ShareIntentReceiverActivity}: java.lang.SecurityException: Permission Denial: reading com.gallery20.common.GYFileProvider ...  requires the provider be exported, or grantUriPermission()

Steps to reproduce the behavior

  • Open the File Manager app
  • Select a media file from the thumbnail (do not open it, if it's from the image preview, there's no crash)
  • Share it into the Jetpack/WordPress app

Note: From 24.0 the crash is prevented but the image is not added due to the error mentioned above.

Tested on a Redmi Note 8T, Android 11, JPAndroid / WPAndroid 23.9, 24.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions