警告:库类android.net.http.AndroidHttpClient扩展或实现程序类org.apache.ht



我在导出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();

}

尝试将其添加到proguard配置文件中。

-libraryjars libsandroid-support-v4.jar
-libraryjars <java.home>librt.jar
-dontwarn org.apache.commons.**

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

看看这个答案

将行添加到gradle.properties(项目属性):在gradle.properties文件中添加android.enableR8.fullMode=false行。

修改proguard-rules.pro(proguard规则):将以下行添加到proguard-rules.pro文件中:

最新更新