Skip to content

[Bug] Share.RequestAsync throws java.lang.SecurityException (uid=1000) on Android 10+ due to missing intent.ClipData #34370

@Marc0d3

Description

@Marc0d3

Description

When attempting to share a locally generated file (e.g., from FileSystem.CacheDirectory) using Share.RequestAsync, the application throws a exception on modern Android devices (Android 10+) with a java.lang.SecurityException.

The exception states: Permission Denial: reading microsoft.maui.essentials.fileProvider uri... from uid=1000 requires the provider be exported, or grantUriPermission().

Steps to Reproduce

  1. Download the Sample Project
  2. Run the app on an Android 10+ device (e.g., Android 13)
  3. Attempt to share the "dotnet_bot" file using MAUI Essentials, via the Share button
  4. Trigger the Share Image Button, the action will succeed but a preview image will not be shown for the share action and a error will be shown in the output window.
  5. Trigger the Share Image (Fixed ClipIntent) Button to observe that using a native Android implementation that explicitly sets the ClipIntent fixes the error
Image Image Image

Link to public reproduction project repository

https://github.com/Marc0d3/MauiMissingClipIntent

Version with bug

10.0.1

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 10+ (API 29 and higher). Specifically reproduced on Android 13.

Did you find any workaround?

Yes. Bypassing Share.RequestAsync and using a native Android implementation that explicitly sets ClipData resolves the issue completely. This can be tested out in the sample project.

Relevant log output

14:05:15:215	03-08 14:05:12.860 E/DatabaseUtils(10599): java.lang.SecurityException: Permission Denial: reading microsoft.maui.essentials.fileProvider uri content://com.companyname.mauimissingclipintent.fileProvider/internal_cache/dotnet_bot.png from pid=9976, uid=1000 requires the provider be exported, or grantUriPermission()

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-imageImage loading, sources, cachingpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions