Flutter Google Maps Android构建失败

时间:2020-04-13 17:04:12

标签: android flutter kotlin gradle google-maps-flutter

我试图将Google地图添加到我的Flutter项目中

dependencies:

  geolocator: ^2.1.0
  google_maps_flutter:
<manifest ...
  <application ...
    <meta-data android:name="com.google.android.geo.API_KEY"
               android:value="my key was here"/>

问题是添加此依赖项后,每次运行-构建都会失败,并显示以下消息:

FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
The following dependencies do not satisfy the required version:
project ':google_api_availability' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
Finished with error: Gradle task assembleDebug failed with exit code 1

当然,正如其他帖子中所建议的那样,我尝试将gradle版本更改为另一个版本,但没有帮助。 我真的不知道问题出在哪里,因为我没有检查地图就编译了项目。

1 个答案:

答案 0 :(得分:0)

您必须通过运行命令geolocator

来升级依赖于google_api_availability的{​​{1}}软件包。