balban shah balban shah - 9 months ago 70
Android Question

java.lang.NoClassDefFoundError: javax.activation.DataHandler in android

I am making a email sending application in android phone. For that I included two jar file

activation. jar
. But when I run this application and try to send the mail, I got following error on

java.lang.NoClassDefFoundError: javax.activation.DataHandler

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

Answer Source

There is an Android-friendly port of javamail which you should be using. There are three libraries that you need to include in your app: mail.jar, activation.jar, and additionnal.jar(sic). It looks like you are missing something that the activation library depends on, and this could be because you are not using the Android port of this library.

I have used the Android-friendly version of javamail successfully in a project, and it works really well.