An app uses Firebase and Google Maps Android SDK.
Firebase works fine by using the google-services.json
file downloaded on the Firebase console.
However the Google Maps API key is provided in the AndroidManifest.xml
file with:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="${google_maps_key}" />
while the google maps key is provided in build.gradle
according to build variant:
manifestPlaceholders.google_maps_key = "<REMOVED>";
The Google Maps feature works in debug
build variant but it doesn't work in release
. The APIs in the Google Cloud Console are enabled and the credentials are correct (SHA1 fingerprints, API restrictions). The Google Cloud console does not show any API requests for the release project.
The google-services.json
contains an API key that I did not find anywhere in the Google Cloud console or Firebase ("api_key": [{ "current_key": <REMOVED> }]
).
Is is possible that JSON file conflicts with the Google Maps API key?
An API key is a unique string that's used to route requests to your Firebase project when interacting with Firebase and Google services.
Googlemaps API key is required for built-in theme map element as it offers advanced options for map style, zoom and marker. However, you may use a standard Google Maps block of WPBakery or Elementor page builder to set up Google maps without API key.
You must include an API key with every Geocoding API request.
You can use the following, note that google_api_key will be automatically generated with google-services.json
if you use google-play gradle plugin (i.e. id("com.google.gms.google-services")
)
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_api_key" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With