proguard + crashlytics崩溃

时间:2016-06-06 20:52:00

标签: android proguard crashlytics android-proguard twitter-fabric

我已经在我的项目中集成了Crashlytics,现在当我启用proguard时,App Crashes。试图将所有类别从崩解学中排除但没有成功

文件proguard-rules.pro文件具有以下内容

-keep class io.fabric.sdk.android.** { *; }
-keep interface io.fabric.sdk.android.** { *; }
-keep class com.digits.sdk.android.core.** { *; }
-keep interface com.digits.sdk.android.core.** { *; }
-keep class com.twitter.sdk.android.** { *; }
-keep interface com.twitter.sdk.android.** { *; }

-keep class io.fabric.** { *; }
-keep interface io.fabric.** { *; }
-keep class com.digits.** { *; }
-keep interface com.digits.** { *; }
-keep class com.twitter.** { *; }
-keep interface com.twitter.** { *; }
-keep class com.crashlytics.** { *; }
-keep interface com.crashlytics.** { *; }
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**

我收到错误

com.example.app E/Answers: Failed to submit events task
    java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@1d060ef0 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@31c1ac69[Shutting down, pool size = 1, active threads = 0, queued tasks = 1, completed tasks = 9]
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2011)
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:793)
        at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:298)
        at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:503)
        at java.util.concurrent.ScheduledThreadPoolExecutor.submit(ScheduledThreadPoolExecutor.java:602)
        at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:593)
        at com.crashlytics.android.answers.AnswersEventsHandler.executeAsync(Unknown Source)
        at com.crashlytics.android.answers.AnswersEventsHandler.processEvent(Unknown Source)

我还查看了crashlytics文档并尝试了所有可能的组合。 有人可以指导我这个

1 个答案:

答案 0 :(得分:2)

来自documentation -

  

首先,Fabric在内部使用注释,因此添加以下内容   line to your configuration file:

-keepattributes *Annotation*
  

接下来,为了提供最有意义的崩溃报告,请添加   以下一行到您的配置文件:

-keepattributes SourceFile,LineNumberTable
  

如果您使用自定义例外,请添加此行以便自定义   在混淆期间跳过异常类型:

-keep public class * extends java.lang.Exception