Ionic 4 + Capacitor + Firebase

When I open Android Studio the sync fails with:

ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add ‘tools:replace=“android:appComponentFactory”’ to element at AndroidManifest.xml:5:5-43:19 to override.

This happens when I add Firebase to the project. The project is Ionic 4 + Capacitor created using the following:

  1. ionic start testApp tabs --capacitor
  2. In my Firebase project I add Android - " Add Firebase to your Android app "
  3. Download google-services.json
  4. Add classpath 'com.google.gms:google-services:4.2.0 to project level build.gradle (already there so ignore this step)
  5. Add implementation ‘com.google.firebase:firebase-core:17.0.0’ to App Level build.gradle
  6. Add apply plugin: ‘com.google.gms.google-services’ to App Level build.gradle
  7. Click the Sync Now button cd myApp
  8. npx cap init testApp com.acmeinc.testApp
  9. ionic build
  10. npx cap add android
  11. npx cap open android

In my Firebase project I add Android - " Add Firebase to your Android app "

  1. Download google-services.json
  2. Add classpath 'com.google.gms:google-services:4.2.0 to project level build.gradle (already there so ignore this step)
  3. Add implementation ‘com.google.firebase:firebase-core:17.0.0’ to App Level build.gradle
  4. Add apply plugin: ‘com.google.gms.google-services’ to App Level build.gradle
  5. Click the Sync Now button

Can anyone help?

Thanks

Marc

@MarcusA

I have the same problem. Have you fix your problem?

Cheers,
Chris

Hello @MarcusA and @ccfiel,

This happens because of breaking changes on Google Dependencies:
https://firebase.google.com/support/release-notes/android#2019-06-17

Now days we are stuck in firebase-core:16.0.9.

Did you tried migrate your project to AndroidX? Have some advise to share on this route?

Best regards,
Bernardo Baumblatt.

hi
after i add a cordova plugin i get this error !

any solution ?