0

I am using the javamail API to send email and httpclient for network access in my app. I refer to the demo gmailsender.Here is the Link: Sending Email in Android using JavaMail API without using the default/built-in app

There is no error when debugging and I can run APK smoothly in my phone.But,when I tried to use proguard generate my signed APK ,I found the console showed me "Proguard returned with error code 1", although I do as the solution Android, javamail and proguard. As a result, I can not built my APK with Proguard.

Can anyone give me a help? The console showed as following:

Proguard returned with error code 1. See console
[2013-09-06 10:32:25 - ] Note: there were 1487 duplicate class definitions.
[2013-09-06 10:32:25 - ] Warning: library class org.apache.log4j.net.SMTPAppender$1    extends  or implements program class javax.mail.Authenticator
[2013-09-06 10:32:25 - ] Warning: there were 1 instances of library classes depending on program classes.
[2013-09-06 10:32:25 - ]          You must avoid such dependencies, since the program classes will
[2013-09-06 10:32:25 - ]          be processed, while the library classes will remain unchanged.
[2013-09-06 10:32:25 - ]         (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
[2013-09-06 10:32:25 - ] java.io.IOException: Please correct the above warnings first.
[2013-09-06 10:32:25 - ]    at proguard.Initializer.execute(Initializer.java:369)
[2013-09-06 10:32:25 - ]    at proguard.ProGuard.initialize(ProGuard.java:212)
[2013-09-06 10:32:25 - ]    at proguard.ProGuard.execute(ProGuard.java:87)
[2013-09-06 10:32:25 - ]    at proguard.ProGuard.main(ProGuard.java:484)
Community
  • 1
  • 1

1 Answers1

0

The note about duplicate classes suggests that you are specifying -injars options or -libraryjars options in your dexguard-project.txt file. You shouldn't do that, since the Android build process already specifies all the necessary -injars, -outjars, and -libraryjars for you.

If you then get warnings about missing classes, you can probably let ProGuard ignore them, e.g.:

-dontwarn somepackage.SomeMissingClass

Cfr. ProGuard manual > Troubleshooting > Warning: can't find superclass or interface.

Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106