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