[SOLVED] Google is not defined in google places autocomplete while testing on android device


I am making places autocomplete and it working properly in browser but gives this error when run in android device. I checked one of the posts from @richardshergold and did all the things mentioned in it but still it doesn’t work. Any help will be appreciated.

getPlace() {
    let input_from = <HTMLInputElement>document.getElementById("places");
    let options = {
        types: [],
        componentRestrictions: { country: "IN" }

    let autocomplete = new google.maps.places.Autocomplete(input_from, options);

    google.maps.event.addListener(autocomplete, 'place_changed', function () {
        let place = autocomplete.getPlace();
        //let geometry = place.geometry;

I have included the link for the google maps api at the top of all the scripts.


declare var google;
outside the class.it did helped me.