0

我正在使用 javamail API 在我的应用程序中发送电子邮件和 httpclient 以进行网络访问。我指的是演示 gmailsender。这里是链接:使用 JavaMail API 在 Android 中发送电子邮件,而不使用默认/内置应用程序

调试时没有错误,我可以在手机上顺利运行 APK。但是,当我尝试使用 proguard 生成我签名的 APK 时,我发现控制台显示“Proguard 返回错误代码 1”,虽然我这样做是解决方案Android、javamail 和 proguard。结果,我无法使用 Proguard 构建我的 APK。

有人可以帮我吗?控制台显示如下:

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)
4

1 回答 1

0

关于重复类的注释建议您在dexguard-project.txt文件中指定 -injars 选项或 -libraryjars 选项。您不应该这样做,因为 Android 构建过程已经为您指定了所有必要的 -injars、-outjars 和 -libraryjars。

如果您随后收到有关缺少课程的警告,您可以让 ProGuard 忽略它们,例如:

-dontwarn somepackage.SomeMissingClass

参照。ProGuard 手册 > 故障排除 >警告:找不到超类或接口

于 2013-09-07T15:26:17.343 回答