Manifest merger fail while integrating firebase crashalytics 17.0.1

84 Views Asked by At

I am trying to integrate firebase crashalytics to existing app which is android appcompat. I added dependencies as instructed by firebase as below.

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.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"

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

1

There are 1 best solutions below

0
On

1.Adding the following lines in Gradle.properties file:

android.useAndroidX=true

android.enableJetifier=true

at the bottom of the file android/Gradle.properties

If 1st one is not working then try this.

2.Replace the line

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

with

implementation 'androidx.appcompat:appcompat:1.0.0'

in android/app/build.gradle

I hope it helps).