使用Action Bar Sherlock的Proguard Android

3

编辑4: 我尝试删除Action Bar Sherlock并且Proguard可以正常运行。所以我猜这是与android-support-v4.jar有关的问题。

我在包含ABS库时尝试过这个方法,但它没有起作用。

-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }

-keepattributes *Annotation*

最后,奇怪的是,我尝试了没有使用ABS库和proguard-android.txt,它也能正常工作。
我不知道问题出在哪里。
我是一名有用的助手,我可以翻译文本。

我已经阅读了很多关于这个问题的问答,并尝试了许多解决方案,但都没有成功。

我尝试过:

-injars libs/**

而且:

-libraryjars  libs/**

还有其他一些事情没有做好,请问你对我应该做什么有何看法?

我正在使用4个外部jar包:

  • apache-mime4j-0.6.jar
  • httpclient-4.2.2.jar
  • httpcore-4.2.2.jar
  • httpmime-4.2.2.jar

这是我尝试导出已签名apk时的错误控制台:

    [2013-10-15 18:36:12 - ExampleProGuard] Proguard returned with error code 1. See console
[2013-10-15 18:36:12 - ExampleProGuard] Note: there were 364 duplicate class definitions.
[2013-10-15 18:36:12 - ExampleProGuard] Warning: library class android.net.http.AndroidHttpClient extends or implements program class org.apache.http.client.HttpClient
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.RequestAddCookies: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.RequestAddCookies: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.RequestAuthCache: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.RequestAuthCache: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.RequestAuthenticationBase: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.RequestAuthenticationBase: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.RequestClientConnControl: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.RequestClientConnControl: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.ResponseAuthCache: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.ResponseAuthCache: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.ResponseProcessCookies: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.client.protocol.ResponseProcessCookies: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.BasicScheme: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.BasicScheme: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSManager
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSName
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSManager
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSName
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSManager
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSContext
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSContext
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSContext
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSException
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSException
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSException
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSManager
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSName
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSContext
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSManager
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.Oid
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.Oid
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSManager
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSName
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSContext
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.GGSSchemeBase: can't find referenced class org.ietf.jgss.GSSException
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.KerberosScheme: can't find referenced class org.ietf.jgss.Oid
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.KerberosScheme: can't find referenced class org.ietf.jgss.Oid
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.KerberosScheme: can't find referenced class org.ietf.jgss.GSSException
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NTLMEngineImpl$NTLMMessage: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NTLMEngineImpl$NTLMMessage: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NTLMEngineImpl$NTLMMessage: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NegotiateScheme: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NegotiateScheme: can't find referenced class org.ietf.jgss.Oid
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NegotiateScheme: can't find referenced class org.ietf.jgss.Oid
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NegotiateScheme: can't find referenced class org.ietf.jgss.GSSException
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NegotiateScheme: can't find referenced class org.ietf.jgss.GSSException
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NegotiateScheme: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NegotiateScheme: can't find referenced class org.ietf.jgss.GSSException
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.NegotiateScheme: can't find referenced class org.ietf.jgss.Oid
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.SPNegoScheme: can't find referenced class org.ietf.jgss.Oid
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.SPNegoScheme: can't find referenced class org.ietf.jgss.Oid
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.auth.SPNegoScheme: can't find referenced class org.ietf.jgss.GSSException
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.AbstractAuthenticationHandler: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.AbstractAuthenticationHandler: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.AbstractHttpClient: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.AbstractHttpClient: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.AuthenticationStrategyAdaptor: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.AuthenticationStrategyAdaptor: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.AuthenticationStrategyImpl: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.AuthenticationStrategyImpl: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.AutoRetryHttpClient: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.AutoRetryHttpClient: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.DefaultRedirectHandler: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.DefaultRedirectHandler: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.DefaultRedirectStrategy: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.DefaultRedirectStrategy: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.DefaultRequestDirector: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.DefaultRequestDirector: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.HttpAuthenticator: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.client.HttpAuthenticator: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.BasicClientConnectionManager: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.BasicClientConnectionManager: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.DefaultClientConnection: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.DefaultClientConnection: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.DefaultClientConnection: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.DefaultClientConnectionOperator: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.DefaultClientConnectionOperator: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.DefaultHttpResponseParser: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.DefaultHttpResponseParser: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.DefaultResponseParser: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.DefaultResponseParser: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.IdleConnectionHandler: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.IdleConnectionHandler: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.InMemoryDnsResolver: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.InMemoryDnsResolver: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.PoolingClientConnectionManager: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.PoolingClientConnectionManager: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.SingleClientConnManager: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.SingleClientConnManager: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.tsccm.AbstractConnPool: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.tsccm.AbstractConnPool: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.tsccm.ConnPoolByRoute: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.tsccm.ConnPoolByRoute: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.tsccm.RouteSpecificPool: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.codec.Base64InputStream: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.codec.Base64InputStream: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.codec.DecoderUtil: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.codec.DecoderUtil: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.codec.QuotedPrintableInputStream: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.codec.QuotedPrintableInputStream: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.descriptor.DefaultBodyDescriptor: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.descriptor.DefaultBodyDescriptor: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.AddressListField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.AddressListField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.ContentDispositionField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.ContentDispositionField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.ContentTypeField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.ContentTypeField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.DateTimeField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.DateTimeField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.MailboxField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.MailboxField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.MailboxListField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.field.MailboxListField: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.message.BodyFactory: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.message.BodyFactory: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.parser.AbstractEntity: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.parser.AbstractEntity: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.storage.DefaultStorageProvider: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.storage.DefaultStorageProvider: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.util.CharsetUtil: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.util.CharsetUtil: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.util.MimeUtil: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard] Warning: org.apache.james.mime4j.util.MimeUtil: can't find referenced class org.apache.commons.logging.LogFactory
[2013-10-15 18:36:12 - ExampleProGuard]       You should check if you need to specify additional program jars.
[2013-10-15 18:36:12 - ExampleProGuard] Warning: there were 134 unresolved references to classes or interfaces.
[2013-10-15 18:36:12 - ExampleProGuard]          You may need to specify additional library jars (using '-libraryjars').
[2013-10-15 18:36:12 - ExampleProGuard] Warning: there were 1 instances of library classes depending on program classes.
[2013-10-15 18:36:12 - ExampleProGuard]          You must avoid such dependencies, since the program classes will
[2013-10-15 18:36:12 - ExampleProGuard]          be processed, while the library classes will remain unchanged.
[2013-10-15 18:36:12 - ExampleProGuard] java.io.IOException: Please correct the above warnings first.
[2013-10-15 18:36:12 - ExampleProGuard]     at proguard.Initializer.execute(Initializer.java:321)
[2013-10-15 18:36:12 - ExampleProGuard]     at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-10-15 18:36:12 - ExampleProGuard]     at proguard.ProGuard.execute(ProGuard.java:86)
[2013-10-15 18:36:12 - ExampleProGuard]     at proguard.ProGuard.main(ProGuard.java:492)

编辑

首先,感谢Eric的回答。

我尝试了:

 -dotwarn org.apache.common.**

并且

 -dontwarn org.**

但是它显示完全相同的控制台错误。
我看到了这个线程,所以我尝试添加一个新的类路径变量,其中包含sdk的路径,但它显示相同的控制台错误。 这是我的project.properties文件,它也引用了Action Bar Sherlock
    # This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-15
android.library=false
android.library.reference.1=../JakeWharton-ActionBarSherlock-5b15c92/actionbarsherlock

编辑2:

正如Action Sherlock Bar 网站上所说,我也尝试了这个方法,而且完全没有改变错误控制台:

-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }

-keepattributes *Annotation*

编辑3:

我尝试将项目中的外部jar包(不是库ABS)移除,但仍然显示完全相同的错误。我不知道它来自哪里。


这里是解决类似问题的方法! - zzy
@eyyo 伙计,你解决了这个问题吗?如果是的话,能否与我分享一下,以便帮助我解决我正在面对的类似问题?谢谢。 - Haresh Chaudhary
@HareshChaudhary 我解决不了这个问题...而且我目前也没有在使用Android。如果你找到了解决方案,请回答这个问题,这样我们就可以给它一个圆满的结局。祝好运! :D - Daniel
2个回答

8

您的库缺少一些类,如org.apache.commons.logging.LogFactory。显然,您的应用程序没有使用这些类,因此您可以告诉ProGuard它是可以接受的。例如:

-dontwarn org.apache.commons.**

请查看ProGuard手册 > 故障排除 > 警告:找不到引用的类

其他类如org.apache.http.**已经存在于Android运行时中。您不应该在应用程序库中重复它们,因为Android运行时中的版本会优先考虑。

请查看ProGuard手册 > 故障排除 > 警告:库类...依赖于程序类...

最后,请勿在配置文件中指定-injars-libraryjars选项。Ant/Eclipse/Gradle构建过程已根据项目内容自动为您指定所有必要的-injars-outjars-libraryjars

请查看ProGuard手册 > 故障排除 > 注意:程序/库类的重复定义


谢谢您的回答。我尝试了这个方法,但是它并没有起作用,因为控制台显示相同的错误。我已经在问题中添加了我的project.properties文件。祝好。 - Daniel
Lafortune先生,感谢您抽出时间。我知道您负责Proguard项目,所以能够直接与您交流对我来说是一种荣幸。我尝试了您的解决方案,但它并没有帮助我,实际上我所做的任何更改都无法解决控制台错误。使用Proguard时,没有ActionBarSherlock的同一项目可以成功导出。我尝试了许多方法(我的问题中有列出),但都无效。您能否给我一些提示或建议?非常感谢。 - Daniel

0

我之前已经在这里回答过了,我也在这里放一遍以便有所帮助。

我曾经遇到过同样的问题,并在某个地方读到了一个解决方法,那就是禁用minifyEnabled,生成签名APK。

buildTypes {
    release {
        minifyEnabled false
        shrinkResources true
        proguardFiles 'proguard-project.txt'
    }

在将buildTool更新到23.0之前,我从未遇到过这个问题。

此外,对于这个较新的版本,你需要将它添加到你的Progaurd.txt文件中。

-keep public class com.google.android.gms.* { public *; }
-dontwarn com.google.android.gms.**

希望这也能帮助解决你的问题。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接