0

I am creating an email sending application in android phone using smtp. For that I included three jar file activation.jar, mail.jar and additionnal.jar. But when try to send the email, I get following exception.

java.lang.NoClassDefFoundError: javax.activation.DataHandler 

so I am not able to figure out this issue. please Help me. Thanks

aaaaa
  • 449
  • 1
  • 5
  • 18
  • 2
    Astha, can you please post your code, so people can know about your issue proper. – Pratik Dasa Nov 14 '14 at 09:57
  • Astha, visit this link it may helpful to you : http://stackoverflow.com/questions/6368704/java-lang-noclassdeffounderror-javax-activation-datahandler-in-android – Pratik Dasa Nov 14 '14 at 09:58
  • I am using all three jar files. But still getting error. – aaaaa Nov 14 '14 at 10:21
  • @Astha can you please post some of your code? – Pratik Dasa Nov 14 '14 at 10:23
  • @Astha have you done or not? – Pratik Dasa Nov 14 '14 at 10:42
  • I expect you have a build problem. You need to make sure that the included JAR files are actually converted to DEX format and put in your APK. You need to find out how to do this with the IDE that you are using. I don't think posting code is going to help here. – David Wasser Nov 14 '14 at 10:52
  • @pratt - I don't think putting code will help. It's a big code. – aaaaa Nov 14 '14 at 11:31
  • @Astha ya you are right, if possible then can you send me it in my email? – Pratik Dasa Nov 14 '14 at 11:32
  • @david - I am not doing username and password authentication before sending the mial. Can it cause the problem? – aaaaa Nov 14 '14 at 11:32
  • @Astha let me debug it and let me know you, may be in some other IDE it will give something else. – Pratik Dasa Nov 14 '14 at 11:33
  • The `NoClassDefFoundError` comes when it is trying to create an instance of `DataHandler`. For some reason, it cannot find that class. It means that you don't have that class in the APK. It makes no difference what kind of authentication you are using. – David Wasser Nov 14 '14 at 11:36

0 Answers0