title: Android - The API key can only be specified once <meta-data> duplicates
body: <p>I’m trying to add Google map in to may app, so I have taken the API key. Unfortunately when I inserted the API key in manifest.xml through a meta-data tag, it automatically inserted another meta-data tag at compile time as shown below. Now it generates below mentioned error. The worst case is, even I delete each of them or both, it automatically generates both tags at compile time again and throws the error. </p>
  
  <p>Any help?</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.exampl.t_collect/com.exampl.t_collect.activity.MapActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2389)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
          at android.app.ActivityThread.access$900(ActivityThread.java:151)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
  .........
  Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
  ..........
  Caused by: java.lang.RuntimeException: The API key can only be specified once. It is recommended that you use the meta-data tag with the name: com.google.android.geo.API_KEY in the &lt;application&gt; element of AndroidManifest.xml
          at com.google.maps.api.android.lib6.c.ad.a(Unknown Source)
          at com.google.maps.api.android.lib6.a.e.a(Unknown Source)
          at com.google.android.gms.maps.internal.CreatorImpl.b(Unknown Source)
  </code></pre>
  
  <p><strong>Manifast.xml meta tags</strong></p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.exampl.t_collect"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="14"
      android:targetSdkVersion="21" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="com.android.alarm.permission.SET_ALARM" /&gt;
  
  &lt;!--
   To retrieve OAuth 2.0 tokens or invalidate tokens to disconnect a user. This disconnect
   option is required to comply with the Google+ Sign-In developer policies
  --&gt;
  &lt;uses-permission android:name="android.permission.USE_CREDENTIALS" /&gt;
  </code></pre>
  
  <p>
      
   
      
      </p>
  
  <pre><code>&lt;android:uses-permission
      android:name="android.permission.WRITE_EXTERNAL_STORAGE"
      android:maxSdkVersion="18" /&gt;
  &lt;android:uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  &lt;android:uses-permission
      android:name="android.permission.READ_EXTERNAL_STORAGE"
      android:maxSdkVersion="18" /&gt;
  &lt;android:uses-permission android:name="android.permission.READ_CALL_LOG" /&gt;
  
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&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;!--
   The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
           Google Maps Android API v2, but are recommended.
      --&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  
  &lt;uses-feature
      android:glEsVersion="0x00020000"
      android:required="true" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:debuggable="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.Login"
          android:label="@string/app_name"
          android:launchMode="singleTask" &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;activity
          android:name="com.exampl.t_collect.activity.Dash"
          android:label="@string/app_name" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.Collection"
          android:label="@string/title_activity_collection" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.Collection1"
          android:label="@string/title_activity_collection" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.Collection2"
          android:label="@string/title_activity_collection" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.Advance"
          android:label="@string/title_activity_advance" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.Customer"
          android:label="@string/title_activity_customer" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.Data_store"
          android:label="@string/title_activity_data_store" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.DataRqeuset"
          android:label="@string/title_activity_data_rqeuset" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.Settings"
          android:label="@string/title_activity_settings" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.PastData_activity"
          android:label="@string/title_activity_past_data" &gt;
      &lt;/activity&gt;
  
      &lt;meta-data
          android:name="com.google.android.gms.version"
          android:value="@integer/google_play_services_version" /&gt;
  
      &lt;receiver android:name="com.exampl.t_collect.util.UploadGPS" /&gt;
  
      &lt;activity
          android:name="com.exampl.t_collect.activity.findTrucks"
          android:label="@string/title_activity_find_trucks" &gt;
      &lt;/activity&gt;
  
      &lt;meta-data
          android:name="com.google.android.geo.API_KEY"
          android:value="AIzaSy*********************************" /&gt;
      &lt;meta-data
          android:name="com.google.android.maps.v2.API_KEY"
          android:value="@string/google_maps_key" /&gt;
  
      &lt;activity
          android:name="com.exampl.t_collect.activity.MapsActivity"
          android:label="@string/title_activity_maps" &gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.exampl.t_collect.activity.MapActivity"
          android:label="@string/title_activity_map" &gt;
      &lt;/activity&gt;
      &lt;!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. --&gt;
      &lt;activity
          android:name="com.google.android.gms.ads.AdActivity"
          android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
          android:theme="@android:style/Theme.Translucent" /&gt;
      &lt;activity
          android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
          android:theme="@style/Theme.IAPTheme" /&gt;
  
      &lt;meta-data
          android:name="com.google.android.gms.wallet.api.enabled"
          android:value="true" /&gt;
  
      &lt;receiver
          android:name="com.google.android.gms.wallet.EnableWalletOptimizationReceiver"
          android:exported="false" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.gms.wallet.ENABLE_WALLET_OPTIMIZATION" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>