I am using the Google API in my application, but can only get the debug ssh to work the with Google API. I have a keystore that I sign with, I've done the same with previous apps in the past and have had no problem. I've also enabled all the API's. I'm signing my app with a release apk. I'm using the SSH1 from that release apk in the SSH1 for the Google API credential. I'm using the Key from Google in my application. I've read all all stack overflow and google docs on this, and have tried pretty much everything, but I cannot get it to work. It only works when I am debugging my app (in which case I use the SSH1 generated by the debug keystore and the Key that I use with that SSH1). However, when I sign with my person release keystore and publish on Beta on the app store and download onto my phone, I get the error that my API key is invalid. Here are my manifest and build files as well as my layout file if that helps. Thank you.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dev.cromer.jason.whatsappening" >
<permission android:name="com.dev.cromer.jason.whatsappening.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.dev.cromer.jason.whatsappening.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@drawable/icon_logo"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".activities.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<activity
android:name=".activities.MapActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name=".activities.SetMarkerTitleActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name=".activities.SearchPlaceActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name=".activities.SetMarkerDescriptionActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name=".activities.MarkerDescriptionActivity"
android:label="@string/app_name" >
</activity>
</application>
</manifest>
Here is my build:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.dev.cromer.jason.whatsappening"
minSdkVersion 15
targetSdkVersion 23
versionCode 12
versionName "1.012"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.android.gms:play-services:7.8.0'
}
and my layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/AppTheme">
<fragment 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"
android:id="@+id/map"
tools:context="com.dev.cromer.jason.whatsappening.activities.MapActivity"
android:name="com.google.android.gms.maps.SupportMapFragment">
</fragment>
<EditText
android:id="@+id/searchBarEditText"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:background="@drawable/textview_border"
android:alpha=".8"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:hint="@string/search_bar_hint"
android:singleLine="true"
android:textColor="#000000"
android:padding="8dp" />
<ImageView
android:id="@+id/poweredBy"
android:contentDescription="@string/powered_by_google_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/powered_by_google_light"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>