android - 警告 : library class android.net.http.AndroidHttpClient 扩展或实现程序类 org.apache.http.client.HttpClient

标签 android

我在导出 android 应用程序时从 proguard 收到这些奇怪的错误。我已经编辑了配置文件。但是我找不到剩下的错误是什么。

我已经添加了外部Jars,配置了-dontwarn,现在我找不到剩下的问题。

[2013-11-22 17:13:31 - MyProject] Note: there were 1267 duplicate class definitions.
[2013-11-22 17:13:31 - MyProject] Warning: library class android.net.http.AndroidHttpClient extends or implements program class org.apache.http.client.HttpClient
[2013-11-22 17:13:31 - MyProject]       You should check if you need to specify additional program jars.
[2013-11-22 17:13:31 - MyProject] Warning: there were 1 instances of library classes depending on program classes.
[2013-11-22 17:13:31 - MyProject]          You must avoid such dependencies, since the program classes will
[2013-11-22 17:13:31 - MyProject]          be processed, while the library classes will remain unchanged.
[2013-11-22 17:13:31 - MyProject] java.io.IOException: Please correct the above warnings first.
[2013-11-22 17:13:31 - MyProject]   at proguard.Initializer.execute(Initializer.java:321)
[2013-11-22 17:13:31 - MyProject]   at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-11-22 17:13:31 - MyProject]   at proguard.ProGuard.execute(ProGuard.java:86)
[2013-11-22 17:13:31 - MyProject]   at proguard.ProGuard.main(ProGuard.java:492)

我的 ProGuard 配置文件:

# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#

-libraryjars /libs/commons-codec-1.6.jar
-libraryjars /libs/commons-logging-1.1.3.jar
-libraryjars /libs/fluent-hc-4.3.jar
-libraryjars /libs/gson-2.2.4.jar
-libraryjars /libs/httpclient-4.3.jar
-libraryjars /libs/httpclient-cache-4.3.jar
-libraryjars /libs/httpmime-4.3.jar
-libraryjars /libs/picasso-2.0.1.jar
-libraryjars /libs/picasso-2.0.1.jar


-dontwarn javax.xml.stream.events.**
-dontwarn com.squareup.okhttp.**
-dontwarn com.google.android.gms.auth.GoogleAuthUtil
-dontwarn com.squareup.picasso.OkHttpLoader
-dontwarn com.squareup.picasso.OkHttpDownloader
-dontwarn org.apache.commons.logging.impl.AvalonLogger
-dontwarn org.apache.commons.logging.impl.Log4JLogger
-dontwarn org.apache.commons.logging.impl.LogKitLogger
-dontwarn org.apache.commons.logging.impl.ServletContextCleaner
-dontwarn org.apache.http.impl.auth.GGSSchemeBase
-dontwarn org.apache.http.impl.auth.KerberosScheme
-dontwarn org.apache.http.impl.auth.SPNegoScheme
-dontwarn org.apache.http.impl.client.cache.ehcache.EhcacheHttpCacheStorage
-dontwarn org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage
-dontwarn org.apache.http.impl.auth.NegotiateScheme


-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();


}

最佳答案

尝试将其添加到混淆器配置文件中。

-libraryjars libs\android-support-v4.jar
-libraryjars <java.home>\lib\rt.jar

-dontwarn org.apache.commons.**

另外,为什么你有两次 -libraryjars/libs/picasso-2.0.1.jar

看看this answer

关于android - 警告 : library class android.net.http.AndroidHttpClient 扩展或实现程序类 org.apache.http.client.HttpClient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20144244/

相关文章:

java - 为什么 RGBA 位图需要 3x3 数组来存储 1 个像素,如何避免这种情况?

android - 如何在 Android 中使用 Java 邮件将应用程序电子邮件同步到服务器电子邮件?

android - 在 Android 应用中记住我

android - Retrofit2 ,Rxjava 中的过滤列表响应

java - 通过通用方法访问 Java 中的各种枚举

android - 如何在 Gradle 中访问 ext 变量

android - Picasso Android 不加载类型 "content://"的 Uri

android - 在 gmail 中打开的链接不再是打开 Intent 。这是因为 gmail 已更新为嵌入式应用内浏览器吗?

android - Cordova InAppBrowser 不工作

android - 在 Android Studio (LogCat) 中禁用日志 Chrome