Bug? Problem sending Attachments on marshmallow

Tommaso

Member
Licensed User
Longtime User
Hi all,
I've a problem sending email with attachments on marshmallow device (Nexus 5x)
Gmail Appear fine but prompt this error "impossibile allegare un file vuoto" - Unable to attach empty file (i've check Attached file, exist and isn't empty)

application works fine on android 5.x device but doesn't work on 6.x

B4X:
'Sul click della label Info Mando la mail con l'UDID per l'attivazione
    Dim mailapp As Email
    mailapp.Subject = "Contatto da Android"

    Dim Codice As String = CreaEmail
    'Imposto il testo della mail
    mailapp.Body = "In allegato il contatto"
    mailapp.To.Add("support@palmosoft.com")
   
    'Allego l'attivazione
    File.WriteString(File.DirRootExternal, Codice & ".txt", Codice)
   
    Dim list1 As List
    list1 = File.ReadList(File.DirRootExternal, Codice & ".txt")
    For x = 0 To list1.Size - 1
        Log(list1.Get(x))
    Next
   
    mailapp.Attachments.Add(File.DirRootExternal & "/" & Codice & ".txt")
    'Mando la mela
    StartActivity(mailapp.GetIntent)

Thanks in advance for support
regards
Tommaso
 

Tommaso

Member
Licensed User
Longtime User
Hi Erel
I've try your sample code but I've the same result
"impossibile allegare un file vuoto" - Unable to attach empty file



I've this problem on Lg Nexus 5X (Android 6.0.1). It works fine on other device.

Maybe I miss something (any permission on Manifest??)
Any idea may be appreciated

Thanks
Tommaso
 

Tommaso

Member
Licensed User
Longtime User
I've tested it on Nexus 5 running Android 6.0.1. What did you set the targetSdkVersion to?

Hi Erel,
It's a permission problem on email client, I've found that on Gmail Application - Autorization there are some flag,
Enabling Archiviazione - Storage it works fine


Thanks for support
Regards
Tommaso
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…