This is my first attempt at creating an android application. In trying to use the Awareness API provided by Google I receive a SecurityException in logcat, and the error:
If you get this error in the Pre-launch reports in the Google Play Console, check "Opt-out of generating pre-launch reports where X is re-signed" in the Pre-launch settings.
It seems like your API_KEY is set up incorrectly in the AndroidManifest: note that the right package name is
"com.google.android.awareness.API_KEY"
and not
"com.google.awareness.API_KEY"
as you seem to have it. See https://developers.google.com/awareness/android-api/get-started
In my case issue is resolved by adding following meta data tag in manifests.xml file
<meta-data
android:name="com.google.android.awareness.API_KEY"
android:value="API_KEY"/>
And there must exist the following tag as well
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="API_KEY" />
If someone facing similar issue with correct manifest declaration as mentioned in Google here can try generating API key on Google Developer Console using debug keystore for testing purpose and replacing same with release keystore while going to production.
How generate API key? Please check out Google's word itself Here
Hope it will help someone in future.
Print this to the console: (new Status(403)).getStatusMessage()
. It should show status message of the error. Read more here