以下是我编辑proguard.txt的方法。在导出apk之前还有其他我需要做的事吗?因为它现在在proguard中返回错误代码1。
-keep class com.facebook.** { *; }
-keep public class com.google.** { *; }
-keep class org.apache.commons.logging.** { *; }
-keep class com.amazonaws.services.sqs.QueueUrlHandler { *; }
-keep class com.amazonaws.javax.xml.transform.sax.* { public *; }
-keep class com.amazonaws.javax.xml.stream.** { *; }
-keep class com.amazonaws.services.**.model.*Exception* { *; }
-keep class org.codehaus.** { *; }
-keepattributes Signature,*Annotation*
-dontwarn javax.xml.stream.events.**
-dontwarn org.codehaus.jackson.**
-dontwarn org.apache.commons.logging.impl.**
-dontwarn org.apache.http.conn.scheme.**
-dontwarn com.amazonaws.services.securitytoken.**
这是错误
[2014-07-08 18:43:49 - TuenmunTravel] Proguard returned with error code 1. See console
[2014-07-08 18:43:49 - TuenmunTravel] Note: there were 1 duplicate class definitions.
[2014-07-08 18:43:49 - TuenmunTravel] (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
[2014-07-08 18:43:49 - TuenmunTravel] Warning: com.amazonaws.AmazonWebServiceRequest: can't find referenced class org.apache.http.annotation.NotThreadSafe
[2014-07-08 18:43:49 - TuenmunTravel] Warning: com.amazonaws.ClientConfiguration: can't find referenced class org.apache.http.annotation.NotThreadSafe
[2014-07-08 18:43:49 - TuenmunTravel] Warning: com.amazonaws.DefaultRequest: can't find referenced class org.apache.http.annotation.NotThreadSafe
[2014-07-08 18:43:49 - TuenmunTravel] Warning: com.amazonaws.RequestClientOptions: can't find referenced class org.apache.http.annotation.NotThreadSafe
[2014-07-08 18:43:49 - TuenmunTravel] Warning: com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider: can't find referenced class com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient
[2014-07-08 18:43:49 - TuenmunTravel] Warning: com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider: can't find referenced class com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient
[2014-07-08 18:43:49 - TuenmunTravel] Warning: com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider: can't find referenced class com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient
感谢您的帮助
答案 0 :(得分:2)
在我的情况下,如果我只是简单地告诫它会崩溃
我添加以下内容以保持该类,并且到目前为止它的工作原理
-keep class org.apache.commons.logging.** { *; }
-keep class com.amazonaws.services.sqs.QueueUrlHandler { *; }
-keep class com.amazonaws.javax.xml.transform.sax.* { public *; }
-keep class com.amazonaws.javax.xml.stream.** { *; }
-keep class com.amazonaws.services.**.model.*Exception* { *; }
-keep class com.amazonaws.internal.** { *; }
-keep class org.codehaus.** { *; }
-keep class org.joda.convert.* { *; }
-keepattributes Signature,*Annotation*,EnclosingMethod
-keepnames class com.fasterxml.jackson.** { *; }
-keepnames class com.amazonaws.** { *; }
答案 1 :(得分:1)
如果您的应用程序在调试模式下工作,尽管列出了缺少的类,您也可以忽略其余的警告:
-dontwarn com.amazonaws.**