2
votes

I want to use Google Maps Distance Matrix API, Google Maps Direction API and Google Places API for Android for autocomplete.

I want to have a unique API key for all.

In my manifest file I have added

<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_geo_maps_key"/>

The key works fine with PlaceAutocomplete alone. But gives authorization error for other APIs.

  • I have enabled the APIs.
  • I have set SHA1 fingerprint in my Android API as com.packagename SHA1 key of debug.keystore

So how do I use one API key for all the APIs?

1
I have the same problem... Someone Please explain the solution - R.K

1 Answers

1
votes

You are experiencing authorization error for Google Maps Distance Matrix API and Google Maps Direction API because it is a Google Maps Javascript API and you will be needing a Server Key for this one. See Directions - Get a Key/Authentication and Distance Matrix - Get a Key/Authentication.