首页 > 解决方案 > 无法安装 Launch Navigator 插件。要求谷歌 api 密钥

问题描述

我正在尝试将启动导航器插件安装到 ionic4 框架中: https ://ionicframework.com/docs/native/launch-navigator

退出代码为 1 失败。在堆栈中,我发现以下内容:

Failed to install 'uk.co.workingedge.phonegap.plugin.launchnavigator': Error: Variable(s) missing: GOOGLE_API_KEY_FOR_ANDROID

¿ 可以在没有 API 密钥的情况下安装吗?¿ 为什么它需要 API 密钥?

我想要实现的是启动具有给定坐标的谷歌地图(或其他导航应用程序),这样我就可以提供一种从当前 GPS 位置导航到给定坐标位置的方法。

¿ 有什么建议或解决方法吗?

标签: ionic-frameworkplugins

解决方案


使用此命令顺利安装。

ionic cordova plugin add uk.co.workingedge.phonegap.plugin.launchnavigator --variable GOOGLE_API_KEY_FOR_ANDROID="{your_api_key_here}"

如果您没有 Google API 密钥,那么

遵循谷歌地图 API 文档...

https://developers.google.com/maps/documentation/javascript/get-api-key


推荐阅读