Proguard返回错误代码构建失败 - 1

时间:2016-09-23 11:17:07

标签: android android-proguard worklight-studio

[2016-09-23 16:44:03 - myAppAndroid] Proguard returned with error code 1. See console
[2016-09-23 16:44:03 - myAppAndroid] Note: there were 5021 duplicate class definitions.
[2016-09-23 16:44:03 - myAppAndroid] Warning: library class org.apache.http.impl.client.BasicCookieStore extends or implements
     

程序类org.apache.http.client.CookieStore       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.RequestWrapper扩展或实现   程序类org.apache.http.message.AbstractHttpMessage       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.RequestWrapper扩展或实现   程序类org.apache.http.client.methods.HttpUriRequest       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.BasicHttpRequest扩展或实现程序   class org.apache.http.message.AbstractHttpMessage       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.BasicHttpResponse扩展或实现   程序类org.apache.http.message.AbstractHttpMessage       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.client.HttpClient依赖于程序类   org.apache.http.client.methods.HttpUriRequest       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.client.HttpClient依赖于程序类   org.apache.http.client.methods.HttpUriRequest       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.client.HttpClient依赖于程序类   org.apache.http.client.methods.HttpUriRequest       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.client.HttpClient依赖于程序类   org.apache.http.client.methods.HttpUriRequest       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.AbstractHttpClient取决于程序   class org.apache.http.client.CookieStore       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.AbstractHttpClient取决于程序   class org.apache.http.client.CookieStore       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.AbstractHttpClient取决于程序   class org.apache.http.client.CookieStore       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.AbstractHttpClient取决于程序   class org.apache.http.client.methods.HttpUriRequest       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.AbstractHttpClient取决于程序   class org.apache.http.client.methods.HttpUriRequest       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.AbstractHttpClient取决于程序   class org.apache.http.client.methods.HttpUriRequest       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.AbstractHttpClient取决于程序   class org.apache.http.client.methods.HttpUriRequest       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.BasicCookieStore依赖于程序类   org.apache.http.cookie.Cookie       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.BasicCookieStore依赖于程序类   org.apache.http.cookie.Cookie       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.client.DefaultHttpClient依赖于程序类   org.apache.http.client.CookieStore       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.impl.io.AbstractSessionInputBuffer依赖程序   class org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.io.SessionInputBuffer依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.BasicLineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.BasicLineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.BasicLineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.BasicLineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.BasicLineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.BasicLineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.LineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.LineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.LineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.LineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]警告:库类org.apache.http.message.LineParser依赖于程序类   org.apache.http.util.CharArrayBuffer       [2016-09-23 16:44:03 - myAppAndroid]您应该检查是否需要指定其他程序jar。       [2016-09-23 16:44:03 - myAppAndroid]警告:根据程序类,有32个库类实例。       [2016-09-23 16:44:03 - myAppAndroid]你必须避免这种依赖,因为程序类会       [2016-09-23 16:44:03 - myAppAndroid]被处理,而库类将保持不变。       [2016-09-23 16:44:03 - myAppAndroid] java.io.IOException:请先纠正上面的警告。       [2016-09-23 16:44:03 - myAppAndroid]在proguard.Initializer.execute(Initializer.java:321)       [2016-09-23 16:44:03 - myAppAndroid]在proguard.ProGuard.initialize(ProGuard.java:211)       [2016-09-23 16:44:03 - myAppAndroid]在proguard.ProGuard.execute(ProGuard.java:86)       [2016-09-23 16:44:03 - myAppAndroid]在proguard.ProGuard.main(ProGuard.java:492)

3 个答案:

答案 0 :(得分:0)

这些只是警告。可能你可以通过以下方式忽略它们:

-dontwarn org.apache.http.**

表示:

忽略与包org.apache.http和子包相关的警告。

答案 1 :(得分:0)

首先,请获取您在应用中使用的库的最新版本。

其次在你的proguard文件中使用dontwarn属性

例如,

-keep class twitter4j.** { *; }
-dontwarn twitter4j.**

这是为了跳过twitter4j库抛出的警告。你可以申请你在应用程序中使用的库。

更多参考:

How to use -dontwarn in ProGuard?

您也可以尝试任何这些命令

 -keep class android.support.v4.** { *; }   
    -dontwarn android.support.v4.**
    -dontwarn javax.activation.**
    -dontwarn javax.security.**
    -dontwarn java.awt.**
    -libraryjars <java.home>/lib/rt.jar
    -keep class javax.** {*;}
    -keep class com.sun.** {*;}
    -keep class myjava.** {*;}
    -keep class org.apache.harmony.** {*;}
    -keep public class Mail {*;}        
    -dontshrink

当然是你的图书馆名称

答案 2 :(得分:0)

替换android sdk - &gt;工具 - &gt; Proguard使用newset proguard版本。这样可以正常使用