I recently launched an Android app which makes use of the Google Places autocomplete widget/API. As part of the configuration for this, I added the API key to my Android's manifest file:
<application>
...
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="MY_KEY_HERE"/>
</application>
Furthermore, in the Google Developers console, I enabled this API key for Android devices only, but did not restrict to any particular API. I also entered the correct package name and SHA-1 hash for my app. Now I have the following problem:
- When I deploy the app onto an Android phone directly from Android Studio, the Google APIs all work. This is true whether I use the debug or release mode variant.
- When I publish an APK from the same exact code to the Play Store, and then install the app, everything works except the Google autocomplete API is broken. When trying to access it, it closes right away.
I am certain that what I deployed to the Play Store is in fact the same app running locally, because I had also recently made some minor UI patches, and those also showed up on the store version. I verified several times that the correct key is what appears in the manifest file.
I am at a loss to explain this. This problem is particularly difficult because everything works from Android Studio, so I can't do something like go into debug and try to catch an exception.
If you have some expertise with Android and autocomplete, and you have seen a problem similar to this, then I welcome your answer.