我正在尝试将 firebase crashalytics 集成到现有的 android appcompat 应用程序中。我按照firebase的指示添加了依赖项,如下所示。
buildscript {
// ...
repositories {
// ...
// Add Google's Maven repository (if it's not there already).
google()
}
dependencies {
// ..
// Add the Google Services Gradle plugin (if it's not there already).
classpath 'com.google.gms:google-services:4.3.3'
// Add the Firebase Crashlytics Gradle plugin.
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
}
}
在插件下面添加build.gradle
apply plugin: 'com.android.application'
// Apply the Google Services plugin (if it's not there already).
apply plugin: 'com.google.gms.google-services'
// Add the Firebase Crashlytics plugin.
apply plugin: 'com.google.firebase.crashlytics'
添加的依赖项如下
dependencies {
// Add the Firebase Crashlytics SDK.
implementation 'com.google.firebase:firebase-crashlytics:17.0.1'
// Recommended: Add the Google Analytics SDK.
implementation 'com.google.firebase:firebase-analytics:17.4.3'
}
但是即使我添加了错误清单合并失败tools:replace="android:appComponentFactory"
清单合并失败:属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) 来自 [com.android.support:support-compat:28.0.0],因为添加了 firebase crashalytics