title: Android Studio Error when Creating a Project with a Google Maps Activity
body: <p>When I create a new project in Android Studio with a Google Maps Activity I get the following error when I do the initial build of the project:</p>
  
  <blockquote>
    <p>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:12:5-41:19 to override.</p>
  </blockquote>
  
  <p>When I add:</p>
  
  <p><code>tools:replace="android:appComponentFactory</code></p>
  
  <p>to my <code>AndroidManifest.xml</code> file I get the error below:</p>
  
  <blockquote>
    <p>Manifest merger failed with multiple errors, see logs</p>
  </blockquote>
  
  <p>I've found several potential solutions on StackOverflow but none work.</p>
  
  <p>I've tried several potential solutions that I've found on StackOverflow including:</p>
  
  <ul>
  <li><p>migrating to AndroidX</p></li>
  <li><p>Adding the following lines to my 
  manifest</p></li>
  </ul>
  
  <p><code>tools:replace="android:appComponentFactory</code>
    <code>android:appComponentFactory="whateverString"</code></p>
  
  <ul>
  <li>Removing implementation <code>com.android.support:appcompat-v7:28.0.0-rc01</code></li>
  </ul>
  
  <p>Main Activity code</p>
  
  <pre><code>import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
  
      private GoogleMap mMap;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_maps);
          // Obtain the SupportMapFragment and get notified when the map is ready to be used.
          SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                  .findFragmentById(R.id.map);
          mapFragment.getMapAsync(this);
      }
  </code></pre>
  
  <p>Android Manifest:</p>
  
  <pre><code>&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;!--
           The API key for Google Maps-based APIs is defined as a string resource.
           (See the file "res/values/google_maps_api.xml").
           Note that the API key is linked to the encryption key used to sign the APK.
           You need a different API key for each encryption key, including the release key that is used to
           sign the APK for publishing.
           You can define the keys for the debug and release targets in src/debug/ and src/release/.
      --&gt;
      &lt;meta-data
          android:name="com.google.android.geo.API_KEY"
          android:value="@string/google_maps_key" /&gt;
  
      &lt;activity
          android:name=".MapsActivity"
          android:label="@string/title_activity_maps"&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;
  </code></pre>