title: Generating a Google Maps Release Key
body: <p>So I am using the google maps api in my application. I added the activity and put the api key into the google_maps_api.xml(debug) and then went and created a different api key and put that into google_maps_api.xml under /release which I had to go to the file explorer to find. If I launch the application via the green play button in android studio, the map loads just fine. But when I generate the apk under build the map does not load. I believe this is due to the api not working. One of my concerns is that the only way to edit the google_maps_api(release) is by finding it in the explorer. All help is very much appreciated!</p>
  
  <p>Here is the Manifest:</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.nick.mowen.receiptmanager" &gt;
  
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:fullBackupContent="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
  
          &lt;service android:name=".GeofenceTransitionsIntentService" /&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;meta-data
                  android:name="android.app.default_searchable"
                  android:value=".SearchableActivity" /&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".SettingsActivity"
              android:label="@string/Settings"
              android:parentActivityName=".MainActivity" &gt;
              &lt;meta-data
                  android:name="android.support.PARENT_ACTIVITY"
                  android:value=".MainActivity" /&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".ViewCodeActivity"
              android:label="Receipt Code"
              android:parentActivityName=".MainActivity" &gt;
              &lt;meta-data
                  android:name="android.support.PARENT_ACTIVITY"
                  android:value=".MainActivity" /&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".GetHelp"
              android:label="@string/get_help_title"
              android:parentActivityName=".SettingsActivity" &gt;
              &lt;meta-data
                  android:name="android.support.PARENT.ACTIVITY"
                  android:value=".SettingsActivity" /&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".CodeAdder"
              android:label="@string/title_activity_code_adder"
              android:parentActivityName=".MainActivity"
              android:theme="@style/AppTheme.NoActionBar" &gt;
              &lt;meta-data
                  android:name="android.support.PARENT_ACTIVITY"
                  android:value="com.nick.mowen.receiptmanager.MainActivity" /&gt;
          &lt;/activity&gt;
          &lt;activity android:name=".SearchActivity" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.SEARCH" /&gt;
              &lt;/intent-filter&gt;
  
              &lt;meta-data
                  android:name="android.app.searchable"
                  android:resource="@xml/searchable" /&gt;
          &lt;/activity&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=".LocationPicker"
              android:label="@string/title_activity_location_picker" &gt;
              &lt;meta-data
                  android:name="android.support.PARENT_ACTIVITY"
                  android:value="com.nick.mowen.receiptmanager.CodeAdder" /&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;
  </code></pre>
  
  <p>Here is the build.gradle:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.1"
  
      defaultConfig {
          applicationId "com.nick.mowen.receiptmanager"
          minSdkVersion 16
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:23.0.1'
      compile 'com.android.support:design:23.0.1'
      compile 'com.android.support:recyclerview-v7:23.0.1'
      compile 'com.google.android.gms:play-services-maps:8.1.0'
      compile 'com.google.android.gms:play-services:8.1.0'
  }
  </code></pre>