Flutter google 映射 android 构建失败

Flutter google maps android build failed

我尝试将 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 版本更改为另一个版本,正如其他帖子中所建议的那样,但没有帮助。 我真的不知道是什么问题,因为没有地图项目编译,我检查了。

您必须通过 运行 命令 flutter pub upgrade

升级依赖于 google_api_availabilitygeolocator 软件包