简体   繁体   English

集成 firebase crashalytics 17.0.1 时清单合并失败

[英]Manifest merger fail while integrating firebase crashalytics 17.0.1

I am trying to integrate firebase crashalytics to existing app which is android appcompat.我正在尝试将 firebase crashalytics 集成到现有应用程序 android appcompat 中。 I added dependencies as instructed by firebase as below.我按照 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'
  }
}

added below plugins in build.gradlebuild.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'

added dependency as below添加的依赖项如下

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'
}

but am getting error manifest merger failed even i added tools:replace="android:appComponentFactory"但是即使我添加了tools:replace="android:appComponentFactory"

Manifest merger failed: Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] because of aadding firebase crashalytics清单合并失败:属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] 因为添加了 firebase crashalytics

1.Adding the following lines in Gradle.properties file: 1.在 Gradle.properties 文件中添加以下行:

android.useAndroidX=true

android.enableJetifier=true

at the bottom of the file android/Gradle.properties在文件 android/Gradle.properties 的底部

If 1st one is not working then try this.如果第一个不起作用,那么试试这个。

2.Replace the line 2.更换线路

implementation 
"com.android.support:appcompatv7:${rootProject.ext.supportLibVersion}"

with

implementation 'androidx.appcompat:appcompat:1.0.0'

in android/app/build.gradle在 android/app/build.gradle

I hope it helps).我希望它有帮助)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM