Crashlytics未显示Android版本发布的崩溃 [英] Crashlytics not showing crashes for release build Android

查看:78
本文介绍了Crashlytics未显示Android版本发布的崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临Crashlytics的困扰。不知道我在做什么错。
我有两个buildTypes版本,如下所示。
Gradle文件:

I am facing isssue with Crashlytics. Not sure what I am doing wrong. I have two buildTypes release and debug as below. Gradle file:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'android-apt'
def AAVersion = '4.2.0'

buildscript {
  repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
  }
  dependencies {
    // replace with the current version of the android-apt plugin
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    classpath 'io.fabric.tools:gradle:1.+'
  }
}

apt {
   arguments {
    // you should set your package name here if you are using different application IDs
    resourcePackageName "com.testapp"
   }
}

android {
   compileSdkVersion 25
   buildToolsVersion '25.0.2'

   defaultConfig {
       applicationId "com.testapp"
       minSdkVersion 16
       targetSdkVersion 25
       versionCode 55
       versionName "5.2.0"
       // Enabling multidex support.
       multiDexEnabled true
   }

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        zipAlignEnabled true
        shrinkResources true
        ext.enableCrashlytics = true
        buildConfigField 'Boolean', 'enableCrashlytics', 'true'
    }
    debug {
        applicationIdSuffix ".debug"
    }
}

  lintOptions {
    checkReleaseBuilds false
    abortOnError false
  }
}

allprojects {
   repositories {
       jcenter()
       mavenCentral()
       maven {
          url 
         "https://oss.sonatype.org/content/repositories/snapshots/"
    }
    maven { url "http://dl.bintray.com/populov/maven" }
    maven { url "https://jitpack.io" }
 }
}

dependencies {  
  compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
      transitive = true;
  }
}

apply plugin: 'com.google.gms.google-services'

我还集成了Answers来捕获事件。奇怪的是,Fabric Dashboard中没有崩溃报告。首先,我认为可能是proguard出现了问题,因此我添加了以下几行以确保,但仍然没有运气。不知道我是否需要为发布版本做更多的事情。

I have also integrated Answers to capture events. The strange thing is, that no crashes are getting reported in Fabric Dashboard. First I thought it may be issue with the proguard, so I added below lines to make sure, but still no luck. Not sure if I need to do something more for the release build.

-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**

发布版本正在捕获并向我显示所有数据包括用户数量,事件等信息,但没有崩溃。

The release build is capturing and showing me all the data for number of users, events etc., but no crashes.

我后来添加了debug {} buildType,以将调试版本分离到Fabric上

I had added the debug{ } buildType later, to separate the debug an release build on Fabric dashboard.

我不确定出了什么问题。有人可以帮我吗。

I am not sure what is going wrong. Can someone help me please.

谢谢你,
Sneha

Thank you, Sneha

推荐答案

我能够找出为什么它不起作用。我在添加Fabric时错过了这一点:

I was able to find out why it wasn't working. I missed this point while adding Fabric:

确保Fabric.with()行位于设置UncaughtExceptionHandler的所有其他第三方SDK之后

"Make sure the Fabric.with() line is after all other 3rd-party SDKs that set an UncaughtExceptionHandler"

初始化Fabric之后,我没有遇到一些未捕获的异常处理程序。
但是我不明白的是为什么它可以用于调试而不是发布。如果必须失败,那么它在发布和调试方面也应该失败。

I had few uncaught exception handlers after I had initialised Fabric. But what I didn't understand is why it worked for debug and not release. If it had to fail, it should have failed for both release and debug as well.

它确实解决了我的问题,但是想知道为什么会发生这种情况。

It did fix my issue, but would like to know why that could have happened.

感谢您的帮助。赞赏。

这篇关于Crashlytics未显示Android版本发布的崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆