Для реализации нового Firebase Crashlytics SDK необходимо добавить firebase-crashlytics-gradle
classpath и firebase-crashlytics
зависимость.
В файле build.gradle уровня проекта добавьте плагин Crashlytics Gradle:
buildscript {
repositories {
// Check that you have Google's Maven repository (if not, add it).
google()
}
dependencies {
// ...
// Check that you have the Google Services Gradle plugin v4.3.2 or later
// (if not, add it).
classpath 'com.google.gms:google-services:4.3.3'
// Add the Crashlytics Gradle plugin.
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02'
}
}
allprojects {
repositories {
// Check that you have Google's Maven repository (if not, add it).
google()
}
}
В своем файле build.gradle уровня приложения примените плагин Crashlytics Gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services' // Google Services Gradle plugin
// Apply the Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'
В свой build.gradle уровня приложения добавьте зависимости для Google Analytics и Crashlytics.
dependencies {
// Recommended: Add the Firebase SDK for Google Analytics.
implementation 'com.google.firebase:firebase-analytics:17.2.2'
// Add the Firebase SDK for Crashlytics.
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
}
С здесь .
Если вы переходите с Fabri c, не забудьте обновить google-services.json
(загрузите его с консоли Firebase). Это может измениться после миграции. Миграция описана здесь .
PS ответ для будущих борцов.