title: ERROR: Manifest merger failed : Attribute application@appComponentFactory
body: <p>I have issue an with gradle build in Android Studio . When I add Admob Activity in the project, while adding the dependencies to the project it throws Two errors </p>
  
  <ol>
  <li><p><code>ERROR: Manifest merger failed</code> </p></li>
  <li><p>org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures
  For 1st issue , it suggests like "  Suggestion: add 'tools:replace="android:appComponentFactory"' to  element at AndroidManifest.xml:10:5-32:19 to override.
  "</p></li>
  </ol>
  
  <p>Even after adding tools: <code>replace="android:appComponentFactory"</code> to Androidmanifest gradle sync fails </p>
  
  <p>AndroidManifest :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  package="com.ani.admobcheck"&gt;
  
  &lt;!-- Include required permissions for Google Mobile Ads to run. --&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
      &lt;activity
          android:name=".Ads"
          android:label="@string/title_activity_ads"&gt;&lt;/activity&gt;
      &lt;!-- Include the AdActivity configChanges and theme. --&gt;
      &lt;activity
          android:name="com.google.android.gms.ads.AdActivity"
  
  
      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiM    ode|screenSize|smallestScreenSize"
              android:theme="@android:style/Theme.Translucent" /&gt;
          &lt;activity android:name=".MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  
  
  
      Build.gralde :
      apply plugin: 'com.android.application'
  
      android {
  
      compileSdkVersion 28
  
      defaultConfig {
  
          applicationId "com.ani.admobcheck"
  
          minSdkVersion 15
  
          targetSdkVersion 28
  
          versionCode 1
  
          versionName "1.0"
  
          testInstrumentationRunner      
  
  "android.support.test.runner.AndroidJUnitRunner"
  
      }
  
      buildTypes {
  
          release {
  
              minifyEnabled false
  
              proguardFiles getDefaultProguardFile('proguard-android-    
  
  optimize.txt'), 'proguard-rules.pro'
  
          }
  
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'com.android.support:appcompat-v7:28.0.0'
      implementation 'com.android.support.constraint:constraint-layout:1.1.3'
      implementation 'com.google.android.gms:play-services-ads:18.0.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.2'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
  }
  </code></pre>
  
  <p>I got Sync error as : </p>
  
  <pre><code>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 
  &lt;application&gt; element at AndroidManifest.xml:10:5-32:19 to override.
  </code></pre>
  
  <p>I tried adding <code>tools:replace="android:appComponentFactory"</code> in AndroidManifest</p>