我在基于地图的应用程序上使用Ionic 2框架。我按照步骤包含google.maps的输入法,并且在浏览器上没有遇到离子服务和测试问题。但是在为Android平台进行构建时,我遇到了以下问题。
[08:16:22] ionic-app-scripts 0.0.38
[08:16:23] build prod started ...
[08:16:23] clean started ...
[08:16:23] clean finished in 5 ms
[08:16:23] copy started ...
[08:16:23] ngc started ...
[08:16:24] lint started ...
[08:16:25] copy finished in 2.21 s
[08:16:56] lint finished in 32.03 s
[08:17:29] Error: Error at G:/Projects/.tmp/components/map/map.ts:10:15
[08:17:29] Cannot find namespace 'google'.
[08:17:29] Error at G:/Projects/.tmp/components/map/map.ts:22:27
[08:17:29] Cannot find name 'google'.
[08:17:29] Error at G:/Projects/.tmp/components/map/map.ts:27:18
[08:17:29] Cannot find name 'google'.
[08:17:29] Error at G:/Projects/.tmp/components/map/map.ts:32:19
[08:17:29] Cannot find name 'google'.
[08:17:29] Error at G:/Projects/.tmp/components/map/map.ts:37:26
[08:17:29] Cannot find name 'google'.
[08:17:29] Error at G:/Projects/.tmp/components/map/map.ts:40:24
[08:17:29] Cannot find name 'google'.
[08:17:29] Error at G:/Projects/.tmp/components/map/map.ts:42:21
[08:17:29] Cannot find name 'google'.
[08:17:29] Error at G:/Projects/.tmp/components/map/map.ts:44:26
[08:17:29] Cannot find name 'google'.
[08:17:29] Error at G:/Projects/.tmp/pages/list-page/list-page.ngfactory.ts:642:72
[08:17:29] Supplied parameters do not match any signature of call target.
[08:17:29] Error at G:/Projects/.tmp/pages/list-page/list-page.ngfactory.ts:648:72
[08:17:29] Supplied parameters do not match any signature of call target.
[08:17:29] Error at G:/Projects/.tmp/pages/list-page/list-page.ngfactory.ts:846:72
[08:17:29] Supplied parameters do not match any signature of call target.
[08:17:29] Error at G:/Projects/.tmp/pages/list-page/list-page.ngfactory.ts:852:72
[08:17:29] Supplied parameters do not match any signature of call target.
[08:17:29] Error at G:/Projects/.tmp/pages/detail-page/detail-page.ngfactory.ts:708:73
[08:17:29] Supplied parameters do not match any signature of call target.
[08:17:29] Error at G:/Projects/.tmp/pages/detail-page/detail-page.ngfactory.ts:719:73
[08:17:29] Supplied parameters do not match any signature of call target.
[08:17:29] ngc failed
[08:17:29] ionic-app-script task: "build"
[08:17:29] Error: Error
下面是我的map.ts打字稿文件
的代码片段public map: google.maps.Map;
....
var dflt_latlng = new google.maps.LatLng(52.132633, 5.291266);
var geocoder = new google.maps.Geocoder();
构建平台时无法识别谷歌命名空间。我不确定是否有任何需要更新的配置文件。谢谢你的帮助和时间。