Skip to content Skip to sidebar Skip to footer

Google Place Api Not Working For Android Key

I am using google autocomplete place api. https://maps.googleapis.com/maps/api/place/autocomplete/json?key='My Android Key'&input=Mg%20Ro&components=country:IN the key i ge

Solution 1:

First, try to change existing Android key options or create a new key without package name and fingerprint restriction. If it will work, then you are probably have error in you package name ( .debug suffix is added automatically to package name in debug build )

Also make sure you've added your Android key in your manifest

Solution 2:

For google places api while hitting api it required server key. Create server key with your sha1 fingerprint and use that key for google places api. And in manifest use api key there. Dont get confused api key and server key.

enter image description here

use android key in manifest and server key for places api. Afetr creating SERVER key wait for 5 minutes. Then your server key will be enabled

        StringBuilder sb = new StringBuilder(PLACES_API_BASE+TYPE_AUTOCOMPLETE+OUT_JSON);
        sb.append("?key=" + API_KEY);
        sb.append("&types=(cities)");
        sb.append("&input=" + URLEncoder.encode(input, "utf8"));

here you have to use API_KEY is SERVER key NOT ANDROID key

Post a Comment for "Google Place Api Not Working For Android Key"