2014-02-16 43 views
9

我有一個Android應用程序,它使用Google Volley作爲我的下載代理。我只是試圖使用ProGuard來混淆代碼,並發現在運行時凌亂下載開始失敗。在ProGuard混淆後排氣似乎不起作用

這裏是我的ProGuard配置:

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

-keepattributes *Annotation* 

-dontwarn org.apache.** 

,這裏是我的代碼中看到的錯誤:

Async download FAILED. Exception message: The chosen LogFactory implementation does not extend LogFactory. Please check your configuration. (Caused by java.lang.ClassCastException: The application has specified that a custom LogFactory implementation should be used but Class 'org.apache.commons.logging.impl.LogFactoryImpl' cannot be converted to 'a.a.a.b.c'. Please check the custom implementation. Help can be found @http://commons.apache.org/logging/troubleshooting.html.) 

,如果我做了一些proguard的配置造成了一定的依賴性問題,我想知道。請幫忙。

+0

你真的寫了「come.android.volley」嗎? 「來」有一個錯字。 – Dalmas

+0

@達爾馬斯哦,很好。這是一個錯字。但它仍然沒有工作後,我修正了錯字... –

回答

7

Apache日誌記錄庫在其日誌工廠中使用了一些反射。保持他們的名字應該是足夠了:你的配置

-keep class org.apache.commons.logging.** 

側面說明:-keep class .....總是意味着-keep interface .....,這樣你就可以離開了後者。

+0

它沒有幫助我@Eric。你能告訴我任何其他解決方案嗎?我正在使用STARTAPP SDK與我的應用程序。 –