I have an Android app which uses Google Volley as my download broker. I just tried to use ProGuard to obfuscate the code, and find out the volley download starts failing at runtime.

我有一个Android应用,使用谷歌截击作为我的下载代理。我只是尝试使用ProGuard来混淆代码,并发现截击下载在运行时开始失败。

Here's my ProGuard config:

这是我的混淆器配置:

-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.**

and here is the error I saw in the code:

这是我在代码中看到的错误:

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.)

I was wondering if I did some proguard config caused some dependency problem. Please help out.

我想知道我是否做了一些proguard配置,导致了一些依赖问题。请帮忙。

1 个解决方案

#1


8

The Apache logging library uses some reflection on its log factories. Keeping their names should be sufficient:

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

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

Side-note on your configuration: -keep class ..... always implies -keep interface ....., so you can leave out the latter.

关于你的配置的注意事项:-保留类…始终暗示-保持接口,所以你可以忽略后者。

更多相关文章

  1. Android学习笔记--《第一行代码Android》273页代码解密
  2. Linux下 使用Repo和Git下载Android源代码并编译
  3. Java已经启动,但是返回的退出代码=13 eclipse [duplicate]
  4. MD5加密,java工具类 String 转变成MD5 String 详细代码,工具类And
  5. Android有用的代码片段
  6. Robotium用例通过代码自动解锁屏幕
  7. Android代码性能优化技巧
  8. Android公钥私钥及代码详细解读
  9. android OSChina 客户端源代码剖析

随机推荐

  1. 大文件从指定行开始读取
  2. 如何通过热门/上升的帖子订购
  3. mysql_query会自动执行,但不会在onClick时
  4. php写app接口并返回json数据
  5. PHP环境搭建和编写API接口
  6. ajax php bomt头 utf-8带来的奇怪问题。
  7. MySQL错误1046:未选择数据库
  8. PHP 开发环境配置
  9. php使用gd库将文字转换成图片
  10. 纯php文件不加结束标记的好处