我正面臨着與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儀表板上調試發佈版本。
我不確定發生了什麼問題。有人能幫助我嗎。
謝謝 斯納
如何在應用程序中初始化Crashlytics套件? – Sanoop
@Sanoop:我已經在Application類中初始化了它。如:Fabric.with(this,new Crashlytics()); – Neha
它不適用於只發布版本,對不對? – Sanoop