ionic-framework - 无法安装 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 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
推荐阅读
- c# - 获取文件的最高路径
- azure - 从单日提取文件 - U SQL
- apache-flink - Flink:在 DataStream 和“规则集”之间实现“连接”
- rabbitmq - 有没有办法在 RabbitMQ 队列中设置 TOTAL 消息数限制?x-max-length 不考虑未确认的消息
- php - 调用存储过程时出现错误 1366 (php mysql)
- maven - 运行 Maven Checkstyle 并因错误而失败
- azure - 使用自定义容器环境变量部署 Azure Webapp
- java - 登录后 Keycloak SAML 重定向卡在循环中
- java - 减小音频记录的大小
- php - PHP - 导出为以新行分隔的制表符