title: Android Manifest Merger fails after adding Dependency com.google.android.material
body: <p>We would like to use the most current material design ui elements presented by Google. Therefore I added <code>com.google.android.material:material:1.0.0-beta01</code> in our projects gradle file. But since then I get the following error. </p>
  
  <blockquote>
    <p>Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.0.0-beta01] AndroidManifest.xml:22:18-86
        is also present at [com.android.support:support-compat:28.0.0-beta01] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
        Suggestion: add 'tools:replace="android:appComponentFactory"' to  element at AndroidManifest.xml:5:5-40:19 to override.</p>
  </blockquote>
  
  <p>Without the material library everything works fine. </p>
  
  <p><strong>What I already tried</strong></p>
  
  <ol>
  <li>I changed the ordering of the dependencies (which did obviously not work) </li>
  <li>I also tried to add <code>tools:replace="android:appComponentFactory"</code> to our Manifest file as suggested in the error message. But this left me with a new error message:</li>
  </ol>
  
  <blockquote>
    <p>java.lang.RuntimeException: Manifest merger failed with multiple errors, see logs
        at com.android.builder.core.AndroidBuilder.mergeManifestsForApplication(AndroidBuilder.java:524)
        at com.android.build.gradle.tasks.ProcessManifest.doFullTaskAction(ProcessManifest.java:75)
        at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)</p>
  </blockquote>
  
  <p>I checked the log file but the only warning shown in idea.log is</p>
  
  <blockquote>
    <p>2018-08-08 11:08:21,500 [thread 267]   WARN -
    .tools.idea.model.ManifestInfo - getMergedManifest failed Manifest
    merger failed with multiple errors, see logs  2018-08-08 11:08:21,642
    [thread 267]   WARN - .tools.idea.model.ManifestInfo -
    getMergedManifest failed Manifest merger failed with multiple errors,
    see logs  2018-08-08 11:08:21,917 [J pool 0/7]   </p>
  </blockquote>
  
  <p><strong>More information</strong></p>
  
  <p>API Version</p>
  
  <pre><code>android {
  compileSdkVersion 28
  buildToolsVersion '28.0.0'
  
  defaultConfig {
      minSdkVersion 19
      targetSdkVersion 28
      versionCode 1
      versionName "1.0"
  }
  </code></pre>
  
  <p>(the same API is chosen in file > project structure in Android Studio)</p>
  
  <p>Dependencies:</p>
  
  <pre><code>dependencies {
  api fileTree(include: ['*.jar'], dir: 'libs')
  
  /** ANDROID LIBRARIES  **/
  implementation 'com.android.support:multidex:1.0.2'
  implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
  api 'com.android.support:support-v13:28.0.0-beta01'
  api 'com.google.android.material:material:1.0.0-beta01'
  api 'com.android.support:design:28.0.0-beta01'
  api 'com.android.support:preference-v7:28.0.0-beta01'
  api 'com.android.support:cardview-v7:28.0.0-beta01'
  api 'com.android.support:customtabs:28.0.0-beta01'
  api 'com.android.support:support-v4:28.0.0-beta01'
  
  /** GOOGLE PLAY SERVICE  **/
  api 'com.google.android.gms:play-services-auth:15.0.1'
  
  api 'com.google.android.gms:play-services-drive:15.0.1'
  api 'com.google.android.gms:play-services-fitness:15.0.1'
  api 'com.google.android.gms:play-services-maps:15.0.1'
  api 'com.google.android.gms:play-services-wearable:15.0.1'
  api 'com.google.android.gms:play-services-vision:15.0.2'
  
  api 'com.google.firebase:firebase-core:16.0.1'
  api 'com.google.firebase:firebase-perf:16.0.0'
  api 'com.crashlytics.sdk.android:crashlytics:2.9.4'
  
  //sunrise and sundown calculation for map day and night mode
  api 'com.luckycatlabs:SunriseSunsetCalculator:1.2'
  
  /** GOOGLE MAPS  **/
  implementation 'com.google.maps.android:android-maps-utils:0.5'
  implementation 'com.google.code.gson:gson:2.8.0'
  
  /** EXTERNAL LIBRARIES  **/
  
  implementation 'org.osmdroid:osmdroid-android:5.6.5'
  implementation 'org.osmdroid:osmdroid-mapsforge:5.6.5'
  implementation 'org.mapsforge:mapsforge-map-android:0.6.1'
  implementation 'org.mapsforge:mapsforge-map:0.6.1'
  implementation 'com.caverock:androidsvg:1.2.2-beta-1'
  
  //dropbox api
  implementation 'com.dropbox.core:dropbox-core-sdk:3.0.6'    
  
  androidTestImplementation 'junit:junit:4.12'
  implementation files('libs/samsung-health-data-v1.3.0.jar')}
  </code></pre>
  
  <p><strong>Manifest</strong></p>
  
  <pre><code>&lt;manifest
  package="com.user.libraries.bluetooth"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
  &lt;uses-permission android:name="android.permission.NFC" /&gt;
  &lt;uses-permission android:name="android.permission.BLUETOOTH" /&gt;
  &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.BODY_SENSORS" /&gt;
  &lt;uses-permission android:name="android.permission.VIBRATE"/&gt;    
  
  &lt;application
      tools:replace="android:appComponentFactory"
      android:allowBackup="true"
      android:supportsRtl="true"&gt;
      &lt;service android:name="com.user.libraries.location.LocationService" /&gt;
      &lt;service android:name="com.user.libraries.location.BleLocationTrackerService" /&gt;
      &lt;service android:name="com.user.libraries.sensors.SensorService"/&gt;
  
      &lt;service android:name="com.user.libraries.sharing.DataExchangerService"/&gt;
  
      &lt;receiver
          android:name="com.user.libraries.bluetooth.BluetoothStateReceiver"
          android:enabled="true"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.bluetooth.adapter.action.STATE_CHANGED"/&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
      &lt;provider
          android:name="android.support.v4.content.FileProvider"
          android:authorities="${applicationId}.provider"
          android:exported="false"
          android:grantUriPermissions="true"&gt;
          &lt;meta-data
              android:name="android.support.FILE_PROVIDER_PATHS"
              android:resource="@xml/provider_paths"/&gt;
      &lt;/provider&gt;
  
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any idea how I can solve this issue? </p>