katzer / cordova-plugin-email-composer

Edit and send email messages
Apache License 2.0
344 stars 334 forks source link

Problems attaching audio file to email #54

Closed u2ill closed 9 years ago

u2ill commented 10 years ago

I'm unable to attach an audio file to an email in Android. Using the Android "Mail" client, the client says the attachment is corrupted. I know that it is not corrupted because I can play it back fine. I've tried the following paths, but both result in the same message:

file:///data/data/com.willswebworks.recovery/files/journal/journalEntry-1.amr /data/data/com.willswebworks.recovery/files/journal/journalEntry-1.amr

Any ideas?

u2ill commented 10 years ago

Has ANYONE successfully gotten file attachments on Android working? If so, how are you doing it? What does your code look like? I'm running into the following error, which it seems katzer is saying it's a bug with Android code and closed the issue on here about it:

07-27 07:38:27.734: W/Bundle(20718): Key android.intent.extra.TEXT expected ArrayList but value was a android.text.SpannableStringBuilder. The default value was returned. 07-27 07:38:27.764: W/Bundle(20718): Attempt to cast generated internal exception: 07-27 07:38:27.764: W/Bundle(20718): java.lang.ClassCastException: android.text.SpannableStringBuilder cannot be cast to java.util.ArrayList 07-27 07:38:27.764: W/Bundle(20718): at android.os.Bundle.getCharSequenceArrayList(Bundle.java:1367) 07-27 07:38:27.764: W/Bundle(20718): at android.content.Intent.getCharSequenceArrayListExtra(Intent.java:5091) 07-27 07:38:27.764: W/Bundle(20718): at android.content.Intent.migrateExtraStreamToClipData(Intent.java:7621) 07-27 07:38:27.764: W/Bundle(20718): at android.content.Intent.migrateExtraStreamToClipData(Intent.java:7588) 07-27 07:38:27.764: W/Bundle(20718): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1556) 07-27 07:38:27.764: W/Bundle(20718): at android.app.Activity.startActivityForResult(Activity.java:3505) 07-27 07:38:27.764: W/Bundle(20718): at android.app.Activity.startActivityForResult(Activity.java:3466) 07-27 07:38:27.764: W/Bundle(20718): at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:859) 07-27 07:38:27.764: W/Bundle(20718): at de.appplant.cordova.plugin.emailcomposer.EmailComposer$1.run(EmailComposer.java:124) 07-27 07:38:27.764: W/Bundle(20718): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 07-27 07:38:27.764: W/Bundle(20718): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 07-27 07:38:27.764: W/Bundle(20718): at java.lang.Thread.run(Thread.java:864)

katzer commented 9 years ago

See https://github.com/katzer/cordova-plugin-email-composer#adding-attachments