Cannot find namespace 'google' in ionic 3 app

#1

can anyone help me with this error im getting in my ionic 3 application after my attempt to use google variable in my project,

npm install --save @types/google-maps

which added the following to my package.json:

@types/google-maps”: “^3.2.0”,

i also did declare

declare var google;

and did

typings install dt~google.maps --global

then i seen this soultion and tried it but that did not work either (notice i generated an ios key and android key) tried this https://stackoverflow.com/questions/41359496/cannot-find-namespace-google

ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps --variable API_KEY_FOR_ANDROID=“YOUR_ANDROID_API_KEY_IS_HERE” --variable API_KEY_FOR_IOS=“YOUR_IOS_API_KEY_IS_HERE” $ npm install --save @ionic-native/google-maps

gist for my map.ts thats shooting this error:

Error when i run ionic serve:

Cannot find namespace 'google'.
C:/Users/pkhon/Desktop/k/ItBroken/src/components/map/map.ts
private map: google.maps.Map;
public isMapIdle:boolean;

1 Like
#2

have you got any solution , i am facing the same

#3

try

npm i @types/googlemaps

instead of @types/google-maps