Cannot find namespace 'google' in ionic 3 app

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 ionic2 - Cannot find namespace 'google' - Stack Overflow

ionic cordova plugin add GitHub - mapsplugin/cordova-plugin-googlemaps: Google Maps plugin for Cordova --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

have you got any solution , i am facing the same

try

npm i @types/googlemaps

instead of @types/google-maps