我试图将Google map 添加到我的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版本更改为另一个版本,但这没有帮助。
我真的不知道问题出在哪里,因为我没有检查 map 就编译了项目。
最佳答案
您必须通过运行命令geolocator
来升级取决于google_api_availability
的flutter pub upgrade
软件包
关于android - Flutter Google Maps Android构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61192852/