2017-06-27 53 views
0

我正面臨着與Crashlytics isssue。不知道我做錯了什麼。 我有兩個buildTypes發佈和調試如下。 Gradle文件:Crashlytics沒有顯示崩潰的版本Android

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:[email protected]') { 
     transitive = true; 
    } 
} 

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

我也集成了捕捉事件的答案。奇怪的是,Fabric Dashboard中沒有報告崩潰。首先,我認爲這可能是proguard的問題,所以我在下面添加了以確保,但仍然沒有運氣。不知道是否需要爲發佈版本做更多工作。

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

發佈版本捕獲並向我顯示用戶數量,事件等的所有數據,但沒有崩潰。

我稍後添加了debug {} buildType來分離在Fabric儀表板上調試發佈版本。

我不確定發生了什麼問題。有人能幫助我嗎。

謝謝 斯納

+0

如何在應用程序中初始化Crashlytics套件? – Sanoop

+0

@Sanoop:我已經在Application類中初始化了它。如:Fabric.with(this,new Crashlytics()); – Neha

+0

它不適用於只發布版本,對不對? – Sanoop

回答

2

我能找出爲什麼它不工作。我錯過了這一點,同時增加面料:

「確保Fabric.with()線是設置UncaughtExceptionHandler的所有其他第三方軟件開發工具包之後」

我有幾個未捕獲的異常處理程序我已經初始化後面料。 但我不明白的是爲什麼它工作的調試,而不是釋放。如果它不得不失敗,它在發佈和調試時都應該失敗。

它確實解決了我的問題,但想知道爲什麼會發生這種情況。

謝謝大家的幫助。欣賞它。

相關問題