与Android ADT,Proguard的和外部JAR问题问题、ADT、Android、JAR

2023-09-05 11:19:03 作者:捂着心、说胃疼

所以,我试图让ADT的内置ProGuard的执行工作为我的应用程序。不幸的是,它似乎是一种窒息的各种类的第三方库我引用。 我已经试过各种,如果不是全部,-libraryjars和-keep公班线的组合,我能想到的,但是这一切都没有好。我不认为有Proguard的经历,所以说实话,我不知道我要去哪里错了。我尝试过谷歌,但大部分的信息涉及到Ant脚本。

So, I'm trying to get the ADT's built-in proguard implementation working for my app. Unfortunately, it seems to be choking on various classes in third-party libraries I references. I've tried various, if not all, the combinations of -libraryjars and -keep public class lines I can think of, but it's all to no good. I'm not that experienced with Proguard, so honestly, I don't know where I'm going wrong. I've tried google, but most of the information relates to Ant scripts.

有些事情我已经试过:

行类似-libraryjars C:\用户\戴夫\工作区\ Dropbox_Sync_for_Tasker_and_Locale \ lib目录\ Apache的mime4j-0.6.jar在文件的顶部或底部

Lines like -libraryjars C:\Users\Dave\workspace\Dropbox_Sync_for_Tasker_and_Locale\lib\apache-mime4j-0.6.jar at the top or bottom of the file

行试图使路径这样的相对罐子,没有成功可言。

Lines attempting to make paths to jars like that relatively, to no success at all.

像-keep公共类org.apache.commons.logging.LogFactory行

Lines like -keep public class org.apache.commons.logging.LogFactory

行引用错误线的另一部分,就像-keep公共类org.apache.james.mime4j.field.MailboxListField

Line that refer to the other part of the error lines, like -keep public class org.apache.james.mime4j.field.MailboxListField

总之,错误日志是文本的一个巨大的墙,所以我把它放在一个引擎收录这里

Anyway, the error log is a huge wall of text, so I've put it on a pastebin here.

推荐答案

所以,如果你碰巧发现这个答案,就像,嗯,我有一个问题太多,我希望他张贴了他的解决方案,你也有一半幸运。

So, if you happen to find this answer, and are like, hm, I have that problem too, I wish he posted his solution, you're half in luck.

我的方式固定它只是使用了-libraryjars线在那里,然后

The way I fixed it was to just stick the -libraryjars lines in there, and then

-dontwarn org.apache.commons.logging.LogFactory
-dontwarn net.jcip.annotations.NotThreadSafe
-dontwarn net.jcip.annotations.ThreadSafe
-dontwarn net.jcip.annotations.Immutable

和它工作得很好。这是一个黑客,这是肮脏的,但它解决了我。不幸的是,你还是你自己,如果你也有这样的问题。

And it worked fine. It's a hack, and it's dirty, but it solved it for me. Unfortunately, you're still on your own if you too have this problem.