I always get error java.lang.noclassdeffounderror when i sent email use JavaMail for Android (mail.jar).I search so much on internet, but I can't find a solution, please give me sample project. I found http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_%28no_Intents%29_in_Android , but I can't run it .Please help me immediately
Asked
Active
Viewed 358 times
0
-
1`javax.mail.internet.mimebodypart` isn't part of the Android SDK - as a matter of fact, the whole `java.mail.*` package isn't. At a quick glance, however, it seems that functionality is embedded in the `mail.jar`. If your app is unable to find the class at runtime, then it means you probably didn't import the jar correctly in your project. Did you copy the file into your projects's `libs` folder? – MH. Oct 02 '13 at 03:50
-
Yes, I already import it into libs folder, and I searched on internet many way to import it, but it didn't run, so bad. I'm using Eclipse : Version: Kepler Release Build id: 20130614-0229 – lonelyboy0212 Oct 02 '13 at 06:26
-
These are some links , I think they do it fine,but it not run for me,some other *.jar work fine,only mail.jar not work, why??, what's wrong???, so angry. http://mobiledevtuts.com/android/android-sdk-smtp-email-tutorial/ http://mrbool.com/how-to-work-with-java-mail-api-in-android/27800 http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a – lonelyboy0212 Oct 02 '13 at 06:40
-
Does `mail.jar` live in a library project? If so, you may want to try ticking the option to 'export' it (in Eclipse you can find this under the project's Build Options). If that doesn't work then I'm running out of ideas. Perhaps you could attach a simple sample project that suffers from the problem you're describing? That could help us pinpoint the issue more easily. – MH. Oct 02 '13 at 18:10
-
1Hi thanks MH , I did this way, but I still not work. Fortunately , today, I remove all libraries(download from oracle.com) and replace them by libraries at : http://code.google.com/p/javamail-android/downloads/list Surprised, It run fine. – lonelyboy0212 Oct 03 '13 at 07:16