Sending email with attachment, Gmail permission denied

I am trying to send an email with a PDF attachment using the SocialSharing native plugin. It brings up the sharing alert and I select gmail, but then when it goes to gmail I see a toast error saying “permission denied for the attachment”. The email subject, body, etc are all filled in correctly.

I save the file using the File native plugin, to the cordova.file.externalApplicationStorageDirectory location (Android/data/[app-id]/Document.pdf), then pass that filename to the SocialSharing.shareViaEmail function.

File.writeFile(cordova.file.externalApplicationStorageDirectory, 'Document.pdf', blob, { replace: true })
    .then((file) => {
        SocialSharing.shareViaEmail('body', 'subject', ['to@test.com'], [], [], [cordova.file.externalApplicationStorageDirectory + '/Document.pdf']);
    })

I am facing different problem using SocialSharing.shareViaEmail, its attaching the document with email…but when i open it as receiver attachments are missing.
Typical problem, no error thrown.

Same code works in iOS

did anyone of you got the solutions for this, i am using camera plugin to get the image from photo library and gmail says “cannot attach empty image”

Did anyone of you got the solution? At the moment I am facing this “denied permission” error too.