【问题标题】:Volley seems not working after ProGuard obfuscate在 ProGuard 混淆后,Volley 似乎无法正常工作
【发布时间】:2014-02-16 21:08:34
【问题描述】:

我有一个 Android 应用程序,它使用 Google Volley 作为我的下载代理。我只是尝试使用 ProGuard 混淆代码,并发现 volley 下载在运行时开始失败。

这是我的 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 配置导致一些依赖问题。请帮忙。

【问题讨论】:

  • 你真的写了“come.android.volley”吗? “来”有错别字。
  • @Dalmas 哦,不错不错。那是一个错字。但是在我修正错字之后它仍然没有工作......

标签: android obfuscation proguard


【解决方案1】:

Apache 日志库在其日志工厂中使用了一些反射。保留他们的名字就足够了:

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

关于你的配置的旁注:-keep class ..... 总是暗示-keep interface .....,所以你可以省略后者。

【讨论】:

  • @Eric 对我没有帮助。你能告诉我任何其他的解决方案吗?我也在我的应用中使用 STARTAPP SDK。
猜你喜欢
  • 2017-06-02
  • 1970-01-01
  • 1970-01-01
  • 2017-09-04
  • 2012-05-06
  • 2013-02-17
  • 2017-10-09
  • 2017-08-03
  • 2014-05-02
相关资源
最近更新 更多