title: Android - SupportMapFragment with GoogleMaps API 2.0 giving IllegalArgumentException
body: <p>I am trying to use the latest Map API 2.0 provided for Android. I am using the Support Library as I want to support Android 2.2. Following is my code:</p>
  
  <p><strong>Main Activity class</strong></p>
  
  <pre><code>public class MainActivity extends FragmentActivity {
  
      public FragmentManager fManager ;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          fManager = getSupportFragmentManager();
          Button showMapButton = (Button) findViewById(R.id.showMapButton);
          showMapButton.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  loadMapFragment();
              }
          });
      }
  
      private void loadMapFragment() {
          MapPageFragment plotterFragment = new MapPageFragment();
          FragmentTransaction ft = fManager.beginTransaction();
          ft.replace(R.id.allFragmentsFrameLayout, plotterFragment);
          ft.addToBackStack(null);
          ft.commit();
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          getMenuInflater().inflate(R.menu.activity_main, menu);
          return true;
      }
  }
  </code></pre>
  
  <p><strong>Main Activity layout file</strong></p>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity" &gt;
  
      &lt;Button
          android:id="@+id/showMapButton"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:text="Show Map"
          android:layout_marginLeft="30dp"
          android:layout_marginRight="30dp"
          android:layout_marginTop="30dp"
          android:layout_alignParentTop="true" /&gt;
  
  
      &lt;FrameLayout
          android:id="@+id/allFragmentsFrameLayout"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_alignParentTop="true"&gt;
          &lt;!-- Put fragments dynamically --&gt;
      &lt;/FrameLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>Map Fragment Class</strong></p>
  
  <pre><code>public class MapPageFragment extends SupportMapFragment {
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, 
                                           Bundle savedInstanceState) {
          super.onCreateView(inflater, container, savedInstanceState);
          return inflater.inflate(R.layout.map_fragment_layout, container, false);
      }
  
      @Override
      public void onViewCreated(View view, Bundle savedInstanceState) {
          super.onViewCreated(view, savedInstanceState);
      }
  }
  </code></pre>
  
  <p><strong>Map Fragment Layout</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;fragment
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:map="http://schemas.android.com/apk/res-auto"
      android:id="@+id/map"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      class="com.google.android.gms.maps.SupportMapFragment"
      map:uiCompass="true"
      map:mapType= "normal"
      map:uiRotateGestures="true"
      map:uiScrollGestures="true"
      map:uiTiltGestures="true"
      map:uiZoomControls="true"
      map:uiZoomGestures="true" /&gt;
  </code></pre>
  
  <p><strong>Android Manifest File</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest
      xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.mapfragmentexample"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="16" /&gt;
  
      &lt;permission
          android:name="com.plotter.permission.MAPS_RECEIVE"
          android:protectionLevel="signature"/&gt;
      &lt;uses-permission android:name="com.plotter.permission.MAPS_RECEIVE"/&gt;
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name" &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;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="AIzaSyA5FtIeLQ1gGUihZIZPQVi3Yz_0l4NG9PY"/&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Everything is working fine for the first time. i.e. When I click on the <code>Show Map</code> button the map fragment gets loaded and displays the map. When I press <em>back</em> button, the map fragment is unloaded and I can see the <code>Show Map</code> button again.</p>
  
  <p>I face an issue when I press the <code>Show Map</code> button again. I get the following error:</p>
  
  <pre><code>FATAL EXCEPTION: main
  android.view.InflateException: Binary XML file line #2: Error inflating class fragment
      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:699)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:468)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
      at com.mapfragmentexample.MapPageFragment.onCreateView(MapPageFragment.java:17)
      at android.support.v4.app.Fragment.performCreateView(Fragment.java:1460)
      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:911)
      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1088)
      at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
      at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1444)
      at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:429)
      at android.os.Handler.handleCallback(Handler.java:605)
      at android.os.Handler.dispatchMessage(Handler.java:92)
      at android.os.Looper.loop(Looper.java:137)
      at android.app.ActivityThread.main(ActivityThread.java:4503)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:511)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
      at dalvik.system.NativeStart.main(Native Method)
  
  Caused by: java.lang.IllegalArgumentException: Binary XML file line #2: 
         Duplicate id 0x7f040006, tag null, or parent id 0x0 with another fragment 
         for com.google.android.gms.maps.SupportMapFragment
      at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:285)
      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:671)
      ... 18 more
  </code></pre>
  
  <p>I am not getting where I am getting wrong or missing anything.</p>