1

I am developing a android application which generates a PDF using droidtext and sends it as attachment with the email without invoking the email client.

I am using droidtext and java mail api to achieve this.And my lib directory is as follows. Minimum SDK version of 8 !!

enter image description here

activation.jar, additionnal.jar and mail.jar are required for email and droidtext.jar is required for generating pdf. when I run the application I get error as

[2013-08-11 21:09:04 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/apache/harmony/awt/internal/nls/Messages;
[2013-08-11 21:09:04 - SuperResume] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/apache/harmony/awt/internal/nls/Messages;

Any suggestion for its resolution ??

Faisal Memon
  • 774
  • 3
  • 12
  • 28

1 Answers1

0

This happens because some of the awt dependency classes are defined in additionnal.jar and droidText.0.5.jar. The easiest way to fix this is to rename the offending package in one of the two libraries.

E.g. check out droidtext as Android library project as described here: https://code.google.com/p/droidtext/wiki/GettingStarted and then refactor/rename the org.apache.harmony package to some different name

  • Hmm... You do know that DroidText is based on iText 2.1.7 and that it's not wise to use that obsolete version anymore. See http://lowagie.com/itext2 and please use http://sourceforge.net/projects/itextg instead of DroidText. iTextG doesn't need Apache Harmony. By the way: I'm Bruno Lowagie and every time you import com.lowagie you refer to my name. – Bruno Lowagie Aug 17 '13 at 01:06
  • Yes. I'm aware that you're the creator of iText and the fact that droidText is based on a 2.1.7 fork. Like many other projects (e.g. jasper reports) I decided to stick with the last LGPL/MPL version. The AGPL license change makes a new iText version not a viable option for me. –  Aug 17 '13 at 17:12