Android ProGuard 错误找不到超类或接口 org.apache.http.entity
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10666769/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ProGuard error can't find superclass or interface org.apache.http.entity
提问by chrisonline
I get always with ProGuard following error:
我总是遇到以下错误:
[2012-05-19 17:50:13 - xxx] Warning: there were 13 unresolved references to program class members.
[2012-05-19 17:50:13 - xxx] Your input classes appear to be inconsistent.
[2012-05-19 17:50:13 - xxx] You may need to recompile them and try again.
[2012-05-19 17:50:13 - xxx] Alternatively, you may have to specify the option
[2012-05-19 17:50:13 - xxx] '-dontskipnonpubliclibraryclassmembers'.
[2012-05-19 17:50:13 - xxx] Error: Please correct the above warnings first.
[2012-05-19 17:55:40 - xxx] Proguard returned with error code 1. See console
[2012-05-19 17:55:40 - xxx] Note: there were 239 duplicate class definitions.
[2012-05-19 17:55:40 - xxx] Warning: org.apache.http.entity.mime.FormBodyPart: can't find superclass or interface org.apache.james.mime4j.message.BodyPart
[2012-05-19 17:55:40 - xxx] Warning: org.apache.http.entity.mime.HttpMultipart: can't find superclass or interface org.apache.james.mime4j.message.Multipart
[2012-05-19 17:55:40 - xxx] Warning: org.apache.http.entity.mime.MinimalField: can't find superclass or interface org.apache.james.mime4j.parser.Field
My proguard.cfg file is:
我的 proguard.cfg 文件是:
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }
-keepattributes *Annotation*
-keepattributes SourceFile, LineNumberTable
-libraryjars /libs/crittercism_v2_0_1.jar
-libraryjars /libs/dropbox-android-sdk-1.2.2.jar
-libraryjars /libs/FlurryAgent.jar
-libraryjars /libs/httpmime-4.0.3.jar
-libraryjars /libs/json_simple-1.1.jar
I've already added all my external libs so why am I getting always these errors? Can anybody help?
我已经添加了所有外部库,为什么我总是收到这些错误?有人可以帮忙吗?
EDIT 21.05.2012:The problem is if you add "Dropbox" jar AND "ActionBarSherlock". If I add only "Dropbox", I have no problem. If I add only "ActionBarSherlock", I have no problem. But if I added both, I would get the errors above.
编辑 21.05.2012:问题是如果您添加“Dropbox”jar 和“ActionBarSherlock”。如果我只添加“Dropbox”,我没有问题。如果我只添加“ActionBarSherlock”,我没有问题。但是如果我同时添加两者,我会得到上面的错误。
回答by chrisonline
The problem exists if you have added "ActionBarSherlock" and "DropBox" jars to your project. To solve the problem, add the below line to your proguard-project.txt file:
如果您在项目中添加了“ActionBarSherlock”和“DropBox”jar,问题就会存在。要解决此问题,请将以下行添加到您的 proguard-project.txt 文件中:
-dontwarn org.apache.**
The warning will be ignored and it will work because each of the jars alone are working. So I think, this will be the bug in ProGuard, if both are added.
警告将被忽略并且它会起作用,因为每个罐子都在工作。所以我认为,如果两者都添加,这将是 ProGuard 中的错误。
回答by Kerry
Possibly you need to :
可能你需要:
-keep class org.apache.http.**
-keep interface org.apache.http.**
-保持类 org.apache.http.**
- 保持接口 org.apache.http.**
That is assuming of course ProGuard is complaining about the apache classes. Admittedly I am guessing somewhat as I'm no expert on ProGuard.
那当然是假设 ProGuard 抱怨 apache 类。诚然,我有点猜测,因为我不是 ProGuard 的专家。